天天看點

VB.NET中實作控件數組的功能

控件:幾個文本框textbox

事件:TextBoxes_textchanged

Private Sub TextBoxes_TextChanged(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles
TextBox2.TextChanged, TextBox3.TextChanged
Select Case DirectCast(sender, TextBox).Name
Case
"The text in the first TextBox has changed")
Case
"The text in the second TextBox has changed")
Case
"The text in the third TextBox has changed")
End Select
End Sub