473,322 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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 1111
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

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

Similar topics

1
by: Yasutaka Ito | last post by:
Hi, I have an MDI application, in which I want to embed one form (System.Windows.Forms.Form) into a specified area of my MDI application. This is, wihtout affecting the capability of other child...
1
by: JDeats | last post by:
I have a WinForm that is set as an MDIContainer, I have an Panel on this form that has it's docking property set to "Top". When a spawn an MDI childform inside my parent all is well untill I...
1
by: Terry | last post by:
I've seen several posts from people who have seen this flashing in TreeView's when resizing a form. I've noticed it in my app, but only in the child windows. For example, my main form has a...
1
by: Benz. | last post by:
Hello all, I'm having a very strange problem. I've an MDI application with many child forms. In 1 of my Child forms (Say frmA), I've a few design time controls. The forms Autoscroll property is...
6
by: John | last post by:
Hi I have a main form which has a panel which contains a child form using the code; mainform.myPanel.Controls.Add(childform) So hierarchy is like this; MainForm->Panel->ChildForm. My question...
13
by: Martin Ho | last post by:
I know this must be trivial for many of you. But I am playing with this and can't figure it out. I have a form, on that form is one panel which has 3 textboxes, when I run my program and...
2
by: Rich | last post by:
Hello, If I place a panel control on a form and place a datagrid on the panel, is there a property for the panel to resize with the form? I am sure there is. I just can't remember what the...
0
by: VMahaadevan | last post by:
Hi, I have MDI form in that I have 4 panels left panel has treeview control top panel has heading, version, label, Bottom panel has status bar for MDI and right side panel is work area where I...
2
by: Bob Johnson | last post by:
..NET 3.5: I have placed two controls at the top of an Mdi parent form. The top-most control is a Panel that is docked to the Top. Immediately below the Panel is a user control that is Anchored to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.