What's the simplest .NET equivalent of a VB6 control array?

后端 未结 9 1712
时光取名叫无心
时光取名叫无心 2020-12-11 03:42

Maybe I just don\'t know .NET well enough yet, but I have yet to see a satisfactory way to implement this simple VB6 code easily in .NET (assume this code is on a form with

9条回答
  •  生来不讨喜
    2020-12-11 04:10

    Another nice thing that VB .NET does is having a single event handler that handles multiple controls:

    Private Sub TextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) _ 
            Handles TextBox1.TextChanged, _
    
            TextBox2.TextChanged, _
    
            TextBox3.TextChanged
    
    End Sub
    

提交回复
热议问题