-
May 22nd, 2014, 11:36 AM
#1
UserControl won't fit on Form
Hello,
I'm having trouble getting my UserControl to fit snuggly in my panel. Here's a screen shot of what it looks like:
The UserControl is in red and the panel I'm trying to fit it onto is in grey (the white is a ListBox in my UserControl). As you can see, it's going off the right edge of the Form.
I have these settings for both the panel and the UserControl:
AutoSize: true
AutoSizeMode: GrowAndShrink
Anchor: AnchorStyle.Left | AnchorStyle.Top | AnchorStyle.Right
Dock: DockStyle.Top
But for some reason, either the panel or the UserControl doesn't want to shrink down to the appropriate size.
Any help would be very much appreciated.
-
May 22nd, 2014, 12:13 PM
#2
Re: UserControl won't fit on Form
Have you tried Dock: DockStyle.Fill yet?
-
May 22nd, 2014, 12:35 PM
#3
Re: UserControl won't fit on Form
Originally Posted by zips
Have you tried Dock: DockStyle.Fill yet?
That doesn't seem to work.
-
May 22nd, 2014, 09:12 PM
#4
Re: UserControl won't fit on Form
Open the xxx.designer.cs file and make sure the user control has the proper parent control set. It's parent should be the panel.
-
May 23rd, 2014, 11:21 AM
#5
Re: UserControl won't fit on Form
I seem to have solved the problem by docking my ListBox to "top". Thanks for everyone's help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|