#2
apull2021-11-14 23:58
|
Public Class Form1
Dim KJ_A As New ArrayList
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
KJ_A.Add(TextBox1)
KJ_A.Add(TextBox2)
KJ_A.Add(TextBox3)
KJ_A.Add(TextBox4)
KJ_A.Add(TextBox5)
End Sub
Sub Change()
TextBox6.Text = ""
For i = 0 To 4
TextBox6.Text = TextBox6.Text & KJ_A(i).text & ","
Next
End Sub
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
Change()
End Sub
Private Sub TextBox2_TextChanged(sender As Object, e As EventArgs) Handles TextBox2.TextChanged
Change()
End Sub
Private Sub TextBox3_TextChanged(sender As Object, e As EventArgs) Handles TextBox3.TextChanged
Change()
End Sub
Private Sub TextBox4_TextChanged(sender As Object, e As EventArgs) Handles TextBox4.TextChanged
Change()
End Sub
Private Sub TextBox5_TextChanged(sender As Object, e As EventArgs) Handles TextBox5.TextChanged
Change()
End Sub
End Class
请教各位大侠:这种控件数组,有没有办法把所有的Changed事件合并成一个公共的Changed事件?这只是一个样例,实际中这个数组中是有50多个Textbox的……