
Untitled
By: a guest on
May 3rd, 2012 | syntax:
None | size: 0.81 KB | hits: 13 | expires: Never
How to make TextBlock.Text = Slider.Value on slider value change
If Slider1.Value = 1 Then
TextBlock1.Text = "1"
End If
If Slider1.Value = 2 Then
TextBlock1.Text = "2"
End If
If Slider1.Value = 3 Then
TextBlock1.Text = "3"
End If
If Slider1.Value = 4 Then
TextBlock1.Text = "4"
End If
If Slider1.Value = 5 Then
TextBlock1.Text = "5"
End If
If Slider1.Value = 1 Then
TextBlock1.Text = "1"
End If
<Slider x:Name="mySlider"/>
<TextBox x:Name="myTextBox" Text="{Binding ElementName=mySlider,Path=Value}"/>
<Slider x:Name="mySlider" ValueChanged="mySlider_ValueChanged"/>
Private Sub mySlider_ValueChanged(sender As Object, e As RoutedPropertyChangedEventArgs(Of Double))
myTextBox.Text = e.NewValue.ToString()
End Sub