开发者

Two List Boxes side by side and stretchable

开发者 https://www.devze.com 2023-01-03 05:03 出处:网络
I have two list boxes like show below, side by side. They both have anchors on top, bottom, left and right.

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 an开发者_如何学Cyway to achieve this?

Thanks!

Two List Boxes side by side and stretchable


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.


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消