vb2008 wm6 控件数组,如何知道是哪个控件响应事件?
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.LoadDim RB_Array() As System.Windows.Forms.RadioButton
ReDim RB_Array(form1.c)
Dim i, k As Int16
k = form1.c / 2
For i = 0 To k - 1
RB_Array(i) = New System.Windows.Forms.RadioButton
RB_Array(i).Font = New System.Drawing.Font("Tahoma", 14.0!, System.Drawing.FontStyle.Regular)
RB_Array(i).Location = New System.Drawing.Point(0, (i * 25) + 20)
RB_Array(i).Name = "RadioButton" & i + 1
RB_Array(i).Size = New System.Drawing.Size(112, 20)
RB_Array(i).TabIndex = i + 1
RB_Array(i).Text = form1.a(i, 0)
RB_Array(i).Parent = Me
AddHandler RB_Array(i).CheckedChanged, AddressOf rb_array_CheckedChanged
Next
End Sub
Private Sub rb_array_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim i, j, ii, jj As Int16
ii = UBound(form1.a, 1)
jj = UBound(form1.a, 2)
MsgBox(sender.text)
End Sub
红色为报错点,“.NET Compact Framework 的目标版本不支持后期绑定。”请问要如何解决?我是新手,望能说的粗浅些,谢谢了! --------------------编程问答-------------------- --------------------编程问答-------------------- ((RadioButton)sender).Text
这样试试呢,之前C#一直用的,没问题~~~
补充:移动开发 , Windows Phone