Visual Basic 2010 Creating a Control Array

后端 未结 5 1241
你的背包
你的背包 2020-12-21 09:03

How can I make a control array? Or the equivalent.

I am used to Visual Basic 6 which presents the option of whether to create a control array when I copy and paste a

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-21 09:42

    A control array in VB6 solely existed to allow a single event handler for multiple controls of same type.

    You do this in VB.NET by putting the controls into the Handles clause:

    private sub Button_Click(...) Handles Command1.Click, Command2.Click, Command3.Click
    
    end sub
    

提交回复
热议问题