您的位置:首页 > 编程语言 > VB

VB.NET中实现控件数组的功能

2008-12-26 13:48 471 查看
控件:几个文本框textbox

事件:TextBoxes_textchanged

代码:

 

Private 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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  vb.net textbox