By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,897 Members | 1,525 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,897 IT Pros & Developers. It's quick & easy.

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

P: 9
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
Share this Question
Share on Google+
3 Replies


kenobewan
Expert 2.5K+
P: 4,871
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

P: 9
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

P: 9
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.