Reputation: 7005
I'm looking for a way to get the data of control (in this case a Trackbar) inside the trackbar itself.
I got this:
Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
Label1.Text = TrackBar1.Value
End Sub
But I want to replace that "trackBar1." with something like
Label1.Text = THIS_CONTROL.Value
Is this possible in Vb10 ?
Thanks
Upvotes: 0
Views: 83
Reputation: 415745
Use the sender
argument:
Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
Dim THIS_CONTROL As TrackBar = DirectCast(sender, TrackBar)
Label1.Text = THIS_CONTROL.Value
End Sub
Upvotes: 1