Use Slider to Control Label : Slider « Windows Presentation Foundation « VB.Net






Use Slider to Control Label

Use Slider to Control Label
       

<Window x:Class="Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="UseSlider" Height="300" Width="300">
    <Canvas>
        <Slider Name="sliEllipseWidth" Margin="20,0,0,0" Width="100" Height="20"
            HorizontalAlignment="Left" VerticalAlignment="Top"
            TickPlacement="BottomRight" TickFrequency="10"
            Orientation="Horizontal" Value="50" Minimum="10" Maximum="150" LargeChange="10" SmallChange="1" IsSnapToTickEnabled="True" />
        <Slider Name="sliEllipseHeight" Margin="0,20,0,0" Width="20" Height="100"
            HorizontalAlignment="Left" VerticalAlignment="Top"
            TickPlacement="BottomRight" TickFrequency="10"
            Orientation="Vertical" Value="20" Minimum="10" Maximum="150" FlowDirection="LeftToRight" VerticalContentAlignment="Top" LargeChange="10" SmallChange="1" />
           
        <Label Canvas.Left="134" Canvas.Top="1" Height="29" Name="lblWidth" Width="42"
            Content="{Binding ElementName=sliEllipseWidth,Path=Value}" />
        <Label Canvas.Left="0" Canvas.Top="136" Height="29" Name="lblHeight" Width="61"
            Content="{Binding ElementName=sliEllipseHeight,Path=Value}" />
    </Canvas>
</Window>

   
    
    
    
    
    
    
  








Related examples in the same category

1.Slider with Tick Marks (TickFrequency=10, TickPlacement=BottomRight)Slider with Tick Marks (TickFrequency=10, TickPlacement=BottomRight)
2.Slider with Irregular Tick Marks (Ticks=0,5,10,15,25,50,100)Slider with Irregular Tick Marks (Ticks=0,5,10,15,25,50,100)
3.Slider with a Selection Range (IsSelectionRangeEnabled=True, SelectionStart=25, SelectionEnd=75)Slider with a Selection Range (IsSelectionRangeEnabled=True, SelectionStart=25, SelectionEnd=75)
4.Use Slider to scale a LineUse Slider to scale a Line
5.Use Slider to scale a RectangleUse Slider to scale a Rectangle
6.Slider AttributesSlider Attributes
7.Get User Input from a SliderGet User Input from a Slider
8.slider value changed eventslider value changed event