Clone Winform control

后端 未结 2 1854
臣服心动
臣服心动 2021-01-13 03:48

I have a groupox in a VB.NET winform app. The groupbox contains a few Labels, Textboxes and Checkboxes. This was created by simply dragging the controls out of VS toolbox.

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-13 04:24

    What you could do is create a user control based upon your groupbox which would allow its reuse. You could then create the instances you require at runtime and add them to the form.

    Maybe suggest that you look into creating user controls for winforms.

提交回复
热议问题