VB 中如何传递OptionButton控件数组的下标

来源:百度知道 编辑:UC知道 时间:2024/05/12 06:28:16
VB6.0 中一个frame,3个OptionButton组成option1数组,一个txtL,一个cmdDisp,如何在cmdDisp的click事件中将已选择的option的下标传递给txtL.Text啊?
我只知道在Option1_Click(Index As Integer)事件中可以,但我想在select case中调用Option1的下标来判断,如果不在Option1_Click(Index As Integer)事件中将index赋给一个变量去传递的话,该如何做?

txtL.Text = Str(-Option1(0).Value - 2 * Option1(1).Value - 3 * Option1(2).Value-1)
我写的就是不在Option1_Click(Index As Integer)事件中也可以呀
-Option1(0).Value - 2 * Option1(1).Value - 3 * Option1(2).Value-1,这个值就是选中的OPtion1的下标呀

Dim a

Private Sub Option1_Click(Index As Integer)
a = Index
End Sub