今天无意中发现了可以实现控件数组的方法,对于初学.NET不久的我来说有点兴奋了....呵呵
在此留个脚印
Private
Sub TextBoxes_TextChanged()
Sub TextBoxes_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged, TextBox2.TextChanged, TextBox3.TextChanged
Select Case DirectCast(sender, TextBox).Name
Case TextBox1.Name
MsgBox("The text in the first TextBox has changed")
Case TextBox2.Name
MsgBox("The text in the second TextBox has changed")
Case TextBox3.Name
MsgBox("The text in the third TextBox has changed")
End Select
End Sub
Select Case DirectCast(sender, TextBox).Name
Case TextBox1.Name
MsgBox("The text in the first TextBox has changed")
Case TextBox2.Name
MsgBox("The text in the second TextBox has changed")
Case TextBox3.Name
MsgBox("The text in the third TextBox has changed")
End Select
End Sub