Slider Attributes : Slider « Windows Presentation Foundation « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Development
8.Event
9.File Directory
10.Generics
11.GUI
12.Language Basics
13.LINQ
14.Network Remote
15.Security
16.Thread
17.Windows Presentation Foundation
18.Windows System
19.XML
20.XML LINQ
VB.Net Tutorial
VB.Net by API
VB.Net » Windows Presentation Foundation » SliderScreenshots 
Slider Attributes
Slider Attributes
   

<Window x:Class="ControlDemos.Label"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="ControlDemos" Height="300" Width="400">
    <Grid>
      <Slider Name="sl1" Minimum="0" Maximum="100" Value="50" IsSnapToTickEnabled="True" 
      TickPlacement="BottomRight" TickFrequency="5" IsSelectionRangeEnabled="True" 
      SelectionStart="60" SelectionEnd="90" ValueChanged="sl1_ValueChanged"/>
  </Grid>
</Window>


//File:Window.xaml.vb
Imports System
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Data
Imports System.Windows.Documents
Imports System.Windows.Media
Imports System.Windows.Media.Imaging
Imports System.Windows.Shapes
Imports System.Windows.Input
Namespace ControlDemos

  Public Partial Class Label
    Inherits Window

    Public Sub New()
      InitializeComponent()
    End Sub
    Private Sub sl1_ValueChanged(sender As Object, e As EventArgs)
      If sl1.Value < sl1.SelectionStart Then
        sl1.Value = sl1.SelectionStart
      End If

      If sl1.Value > sl1.SelectionEnd Then
        sl1.Value = sl1.SelectionEnd
      End If
    End Sub

  End Class
End Namespace

   
    
    
  
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.Use Slider to Control LabelUse Slider to Control Label
7.Get User Input from a SliderGet User Input from a Slider
8.slider value changed eventslider value changed event
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.