Raise the ValueChanged event only when move the track bar manually

  • Thread starter Thread starter YXQ
  • Start date Start date
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
 
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
 
Back
Top