views:

43

answers:

3

I have two list boxes like show below, side by side. They both have anchors on top, bottom, left and right.

When I stretch the window the left listbox grows over the right one. While I want the margin between them to stay and for both listboxes to expand evenly. Is there anyway to achieve this?

Thanks!

alt text

+4  A: 

Use a Split Container and put one list box on each side. Set that Split Container to Dock Full.

The Split Container should be sufficient for your needs, but for more complicated layouts still you can use a Table Layout Panel.

Brian R. Bondy
A: 

I don't know if there's a style format for this but u could calculate the size of each listbox

listboxsize = (gridsize - margin)/2

lukas
+1  A: 

Use a Table Layout Panel. This would allow you to create two columns each at 50% width. You could then apply your anchors to this panel.

Mongus Pong