0

我正在寻找一种方法来获取轨迹条本身内部的控制数据(在本例中为轨迹条)。

我懂了:

Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
    Label1.Text = TrackBar1.Value
End Sub

但我想替换那个“trackBar1”。有类似的东西

    Label1.Text = THIS_CONTROL.Value

这在 Vb10 中可能吗?

谢谢

4

1 回答 1

1

使用sender参数:

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
于 2013-11-07T03:17:59.647 回答