WinForms: Is there a concept of associating a label with a textbox?

前端 未结 7 834
梦谈多话
梦谈多话 2020-12-18 18:21

I\'m using Visual Studio 2010 with C#. Is there a concept in Windows Forms development of somehow linking a label with is text box? Something so that they move together as

7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-18 19:15

    I 2nd @Neils answer of just creating a user control with a textbox in it. The panel can be used to group controls, but it can be pretty tedious if you have a lot of controls on the form.

    If you want to support more than just textboxes, WinForms allows you to create your own designer. If you inherit your designer from the ParentControlDesigner class, you can drop any control you want into your custom label control.

提交回复
热议问题