WinForms Resizing Problem

  • Thread starter Thread starter Deep Silent Ocean
  • Start date Start date
D

Deep Silent Ocean

Hi All

I am facing problem with WinForms resizing problem...

I have DataGrid and couple buttons and groupbox inside winforms.. When I
resize the winform i want to maintain the distance between control
horizontal and vertically. It ok if the control gets resized..
Let me know if someone has logic for it. I know one thing that I can
catch the onResize even of winforms and then I can do some resizing for
other controls

can anyone give me the logic or set of steps for it ?

Deep Ocean
 
Deep said:
I am facing problem with WinForms resizing problem...

I have DataGrid and couple buttons and groupbox inside winforms.. When I
resize the winform i want to maintain the distance between control
horizontal and vertically. It ok if the control gets resized..
Let me know if someone has logic for it. I know one thing that I can catch
the onResize even of winforms and then I can do some resizing for other
controls

Without seeing the layout of your form, I can't guess what exactly you
want to resize in which way. If you can't do it with the usual mechanisms
of docking and anchoring (a hint: consider using additional invisible
grouping panels), you'll have to calculate the control positions and/or
sizes yourself when the form is resizing.


Oliver Sturm
 
Check out the Anchor and Dock properties of the control and form. Most
resizing tasks can be performed by setting those properties.

If you have very specialized re-sizing needs, then using the OnResize
event as others have suggested would be appropriate.
 
Back
Top