WinForms Resizing Problem

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
 
O

Oliver Sturm

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
 
C

Chris Dunaway

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top