Reputation: 15378
How can I stretch a user control?
I have a userControl it's highlighted in blue. Is's a TabControl.
How do I strech it to fill the entire parent.
And how to make ComboBox stretched if GroupBox changes
Update Please provide the code with this structure: - Window -> panel -> MyuserContorl - MyUserControl -> panel -> tabControl
To all stretched
Upvotes: 0
Views: 912
Reputation: 32447
You can anchor your user control by setting the Anchor
.
Here's a useful article
Edit:
In your user control
this.tabControl.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom)
| AnchorStyles.Left) | AnchorStyles.Right)));
You may also need to Dock
or Anchor
the panel inside your user control
.
In your window
this.userControl.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom)
| AnchorStyles.Left) | AnchorStyles.Right)));
Again you may need to Dock
or Anchor
the panel inside your form.
Upvotes: 2