I have two listboxes displayed side by side.
If I lock the first one to all edges and the second one to all edges they overlap when the app is maximized
If I lock the first one to the top, left and bottom and the second one to all edges and maximize the app the second one expands but the first stays narrow.
How can I make it so that they both evenly expand in the window?
Thanks,
You will have to manipulate their widths during the resize event of their window manually, like calculate the horizontal mid and give the left one this value as width and the right one this value as x and width (or with a certain distance). Or use a plug-in or extension that gives you more sophisticated means of autoresizing/constraint-like layout features.
Thanks guys I will explore both options. I am doing this for a hobby project so I want to keep my cost at zero! I guess I will pull out the dusty calculator!
@Art Gorski Thank you very much this helped greatly.
I adjusted the code you provided for my purpose and placed it in both the “Open” and “Resizing” Window Event Handlers.
'Calculated width for both listboxes
dim w As Integer
w = (Window1.Width - 40) / 2
Listbox1.Width = w
Listbox2.Width = w
'Left Position for Second Listbox
Listbox2.Left = w + 40