Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey guys, have a small issue, I am currently doing a windows form with loads of controls, I have a FlowLayoutPanel with a few lables, filters and buttons. When the screen is maximised everything is fine its just when I minimise the screen that the controls in the FlowLayoutPanel get messed up. Any help is very much apreciated.
Thanks guys
Posted
Updated 30-Aug-12 6:13am
v2
Comments
[no name] 30-Aug-12 12:15pm    
How are the controls "messed up"? If the window is minimized, how do you know that the controls are messed up? Do you mean when you restore the form the controls are messed up?
frostcox 30-Aug-12 14:52pm    
Yeah when I hit restore sorry
Christian Amado 30-Aug-12 13:44pm    
Use Dock property or Anchor. =)
frostcox 30-Aug-12 14:51pm    
I have tried these but nothing works. The controls get hidden behind a data grid that's on the form. Even when I put autoscroll to true they are still hidden.
BillWoodruff 31-Aug-12 7:21am    
What exactly do you mean by the word "filters" here ? thanks, Bill

1 solution

I am unable to duplicate the behavior you describe.

Here's what I did.

1. put a 'Panel on a 'WinForm: set its 'AutoSize to 'false, 'Dock to 'None. see note #1 below

2. put a 'FlowLayoutPanel inside the 'Panel: set its 'Dock property to 'Fill, 'AutoSize to 'true, AutoSizeMode to 'GrowAndShrink.

3. put a bunch of controls on three rows: in the 'FlowLayoutPanel : five 'Buttons on row#1, two multi-line 'TextBoxes on row#2, two 'DataGridViews on row#3.

4. went through every control within the 'FlowLayoutPanel: set every 'AutoSize property to 'true, and every 'AutoSizeMode to 'GrowAndShrink. see note #2 below:

5. ran the project, toggled the visible 'WinForm between minimzed and maximized, and resized the Window arbitrarily: observed no change in the visual appearance and relationships of the controls inside the FlowLayOutPanel.

note #1: set the 'Panel 'Dock to 'Fill in the 'Form, and "all hell" will break loose when you resize the 'Form, or toggle it between 'Maximized and 'Minimized: FlowLayoutPanel control contents will be "scrambled."

note #2: step number #4 above may have been just unnecessary voodoo ?

Finally, I admit to a bias against use of 'FlowLayoutPanel, and its evil twin, 'TableLayoutPanel: they just have not been useful to me ... yet.

best, Bill
 
Share this answer
 
Comments
frostcox 1-Sep-12 15:02pm    
Hi bill, thank you so much for your kind response.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900