我已经动态生成了一些按钮。现在我需要以这样的方式操作它们,即单击一个按钮应该在另一个按钮上执行某些操作。怎么做?我希望代码尽可能简单,因为我正在辅导业余爱好者。
Private Sub NewButton(ByVal ButtonNumber As Integer)
' set the button properties
btn.Name = "Button" & ButtonNumber
btn.Enabled = True
btn.Size = New Size(25, 25)
btn.Visible = True
'use tag to store number of button
btn.Tag = ButtonNumber
' Add button click handler
AddHandler btn.Click, AddressOf btnclick
' Add to this forms controls collection
Me.Controls.Add(btn)
arr1(count) = btn.Name
count = count + 1
End Sub
Private Sub NewButton(ByVal ButtonNumber As Integer)
' set the button properties
btn.Name = "Button" & ButtonNumber
btn.Enabled = True
btn.Size = New Size(25, 25)
btn.Visible = True
'use tag to store number of button
btn.Tag = ButtonNumber
' Add button click handler
AddHandler btn.Click, AddressOf btnclick
' Add to this forms controls collection
Me.Controls.Add(btn)
arr1(count) = btn.Name
count = count + 1
End Sub