简体   繁体   中英

how to set a control inside a user control as a container

I have user control consisting of a 2 buttons and a groupbox (C#). When I add controls inside this user control , I want them to be contained inside the groupbox and not the user control itself. Is there a way to do this ??

Shouldn't be too difficult to do really.

myGroupBox.Controls.Add(control)

Another user left a bit more detailed answer which will probably be of use. Attach components to GroupBox in C#

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM