Raise the ValueChanged event only when move the track bar manually

Y

YXQ

Hello,
I want to raise the ValueChanged event ONLY when i move the track bar
manually, but not the value changed, how to do in the event below? thank you

Private Sub TrackBar1_ValueChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles TrackBar1.ValueChanged
End Sub
 
R

Ryan S. Thiele

Try the MouseUp event. And KeyUp events.

Private Sub TrackBar1_KeyUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles TrackBar1.KeyUp
If e.KeyCode = Keys.Left Then
TrackBar1.Value -= 1
ElseIf e.KeyCode = Keys.Right Then
TrackBar1.Value += 1
End If
End Sub

Private Sub TrackBar1_MouseUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles TrackBar1.MouseUp
Console.WriteLine(TrackBar1.Value)
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top