I have a usercontrol that I’m adding as a control of a main form dynamically. The Mainform is basically empty, except it has a large status bar on bottom.
Problem is, when I set the Dockstyle.Fill option on my usercontrol, the size of the loaded usercontrol extends beyond the statusbar (It fills the entire main form as if the status bar wasn’t there).
How do I prevent this behavior? This is an example of how I dynamically load my form
logicForm = new LogicForm();
this.Controls.Add(logicForm);
logicForm.Dock = DockStyle.Fill;
I just found the solution
I need to bring the form to front in order to properly dock it if I already have some other controls on the main form:
Found here: http://dotnetref.blogspot.kr/2008/08/using-dock-fill-on-control-when-you.html
-________________________-