How to elegantly handle resizing dialog box in 2005?

S

Siegfried Heintze

I have a dialog style application that uses DirectX to play DVD movies.

In the center of the form is the main panel where DirectX displays the
movie. Around the edges are various list controls, checkboxes and buttons.

When the window is resized, I only want the main panel to resize and
everything else to stay as stationary as possible. In the case of vertical
resizing (expansion), I would like the controls on each side of the main
panel to expand proportionately. However, I want the buttons on the bottom
to stay the same giving all the new room to the main panel.

I could override the OnResize and write the logic to reposition all the
controls. Uggghhh... Does .NET 2005 have anything like a java gridbaglayout
manager? I know .NET 2003 could resize a dialog box and allowed you to
specify how it would resize. But this did not give me enough control and I
experienced very ugly results. Is 2005 more sophisticated in this way?

Thanks,
Siegfried
 
D

Dave Sexton

Hi Siegried,

Try the TableLayoutPanel.

If you only want the side panels to expand vertically, then you can create 3 columns and 3 rows. Set the outer columns to an
absolute size and set the middle column to 100%. The top two rows should be 50% each and the bottom row should be set to an
absolute size.

HTH
 
D

Dave Sexton

Update:
The top two rows do not have to be 50% each.

As a matter of fact, you'll probably find that having the top row set to an absolute size and setting the middle row to 100% is what
your after.
 

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