468,769 Members | 1,910 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,769 developers. It's quick & easy.

Resizing problem of a form if it is a child of a panel

Hi,

I have been struggling with this problem in C# for a while.

I have created a form with about 4 panels on it. The main panel is set to fill the screen when it resizes. (Panel1 = Dock Top; Panel2 = Dock Bottom; Panel3 = Dock Left; Panel4 = Dock Fill)

[IMG]c:\temp\panel1.gif[/IMG]

I have another form that I add to this panel 4. The problem is that if I have it open up as part of the form (child form), it resizes (which is correct), but also all buttons etc. on the form resizes and moves away from its posistion.

Expand|Select|Wrap|Line Numbers
  1.             frmCrewLogon frmCrew = new frmCrewLogon();
  2.             frmCrew.TopLevel = false;
  3.             frmCrew.Dock = DockStyle.Fill;
  4.             panel4.Controls.Clear();
  5.             panel4.Controls.Add(frmCrew);
  6.  
  7.             frmCrew.Show();
  8.  
  9.  
How can it prevent this, as I tried to lock down the buttons etc?
Apr 29 '08 #1
3 987
kenobewan
4,871 Expert 4TB
Does the image prove too big and displace everything? I believe that you have a few options, are you using css?
Hi,

I have been struggling with this problem in C# for a while.

I have created a form with about 4 panels on it. The main panel is set to fill the screen when it resizes. (Panel1 = Dock Top; Panel2 = Dock Bottom; Panel3 = Dock Left; Panel4 = Dock Fill)

[IMG]c:\temp\panel1.gif[/IMG]

I have another form that I add to this panel 4. The problem is that if I have it open up as part of the form (child form), it resizes (which is correct), but also all buttons etc. on the form resizes and moves away from its posistion.

Expand|Select|Wrap|Line Numbers
  1.             frmCrewLogon frmCrew = new frmCrewLogon();
  2.             frmCrew.TopLevel = false;
  3.             frmCrew.Dock = DockStyle.Fill;
  4.             panel4.Controls.Clear();
  5.             panel4.Controls.Add(frmCrew);
  6.  
  7.             frmCrew.Show();
  8.  
  9.  
How can it prevent this, as I tried to lock down the buttons etc?
Apr 29 '08 #2
I don't have an image on the form. It is only a form with buttons and some groupboxes.

When I the form directly as an parent and don't dock.fill it, it works fine, but otherwise it is a problem.

And no, I don't use css


Does the image prove too big and displace everything? I believe that you have a few options, are you using css?
Apr 29 '08 #3
Sorry, also see where the confusions comes in. The [IMG]...[/IMG] that was refered to in the original post was to show a sreenshot of the problem and is NOT part of my code.

I have a straight forward windows application with one main form and a sub (child) form loading with in it.

Hopefully that is as clear as mud :)


I don't have an image on the form. It is only a form with buttons and some groupboxes.

When I the form directly as an parent and don't dock.fill it, it works fine, but otherwise it is a problem.

And no, I don't use css
Apr 29 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by JDeats | last post: by
1 post views Thread by Benz. | last post: by
6 posts views Thread by John | last post: by
2 posts views Thread by Rich | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.