Reputation: 447
I have been working on a project in c# and I have the starting box size pretty small around, 700px by 450px.
Everything looks great on that size but when I maximize it, all the forms and etc stay the same size and just stick to the corner of the window.
I am curious if there is a way to get the boxes to adjust accordingly to the size of the actual windows form so if they click on the maximize button it doesn't look weird.
I have looked quite a bit online and everything I have tried doesn't seem to work. Also I am using visual studio 2013.
Thanks for the help!
Upvotes: 2
Views: 109
Reputation: 49
I'm not sure I 100% understand what's going on, and please excuse me if I'm just saying things you already know, but controls inside of forms can be anchored. This helps because--for instance-- if a control is anchored on all sides then no matter how the form they reside in is resized they will grow with it. The anchor property is in the property window. As far as forms inside of forms that you would just have to grab the size property of the mdi window and grow the child forms based on this. You could use the resize event in mdi form to fire off an interface method that all of your child forms implement maybe?
Upvotes: 1
Reputation: 3769
Learn how to use the Anchor
or Dock
properties to position and size controls relative to their container in WinForms
Upvotes: 0