WPF VB.Net Tutorial

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="WPF" Height="200" Width="300">
    
                           HorizontalAlignment="Center" Name="txtSliderValue" />
                        Name="slider1" TickPlacement="TopLeft" 
                Ticks="100, 200, 400, 800" Value="0"
                ValueChanged="slider_ValueChanged" />
                        Click="GetSliderValue_Click">Get Slider 1 Value
                        Minimum="0" Name="slider2" TickFrequency="25" 
                TickPlacement="BottomRight" Value="1000" 
                ValueChanged="slider_ValueChanged" />
                        Click="GetSliderValue_Click">Get Slider 2 Value
    


//File:Window.xaml.vb
Imports System.Windows
Imports System.Windows.Controls
Namespace WpfApplication1
  Public Partial Class Window1
    Inherits Window
    Public Sub New()
      InitializeComponent()
    End Sub
    Private Sub GetSliderValue_Click(sender As Object, e As RoutedEventArgs)
      Dim button As Button = TryCast(e.OriginalSource, Button)
      Dim message As String = "Unknown slider."
      If button Is btnGetSliderValue1 Then
        message = "Slider1 value = " + slider1.Value
      ElseIf button Is btnGetSliderValue2 Then
        message = "Slider2 value = " + slider2.Value
      End If
      MessageBox.Show(message, Title)
    End Sub
    Private Sub slider_ValueChanged(sender As Object, e As RoutedPropertyChangedEventArgs(Of Double))
      Dim slider As Slider = TryCast(e.OriginalSource, Slider)
      If slider IsNot Nothing Then
        txtSliderValue.Text = slider.Value.ToString()
      End If
    End Sub
  End Class
End Namespace