Best way to implement 2 controls on one window

  • Thread starter Thread starter Boni
  • Start date Start date
B

Boni

Dear all,
what is the best way to place to controls (listboxes) on the form, so that
the first listbox takes 2/3 of the form and the second 1/3. This proportion
should also stay if window is resized or moved.
Thanks a lot,
Boni
 
Dear all,
may be it was not clear what I want. If you want to full the form with one
control you would normally use form.dock= DockFill. But if there are 2
controls on the form and they must be side/by side and filling the whole
form even if form is resized, what is the best way to implement such
behavoir?
Thanks,
 
Boni said:
Dear all,
may be it was not clear what I want. If you want to full the form
with one control you would normally use form.dock= DockFill. But if
there are 2 controls on the form and they must be side/by side and
filling the whole form even if form is resized, what is the best way
to implement such behavoir?
Thanks,

Set the controls' location and size in the Form's Resize event.


Armin
 
Dear all,
may be it was not clear what I want. If you want to full the form with one
control you would normally use form.dock= DockFill. But if there are 2
controls on the form and they must be side/by side and filling the whole
form even if form is resized, what is the best way to implement such
behavoir?
Thanks,

If you want, for example, to have two container type controls on a
form (like panels):
1) Dock one of the Panels, Left, and the other Panel, Right.
2) In the Form's Layout Event add:
Me.Panel1.Width = 1 + Me.ClientSize.Width \ 2
Me.Panel2.Width = 1 + Me.ClientSize.Width \ 2


For non-containers, you might look at using the TableLayoutPanel, Dock
Fill, with 2 coloumns, 1 row, columns @50%. Drop a control in each
column and set those controls to 'Fill'.

Gene
 
Back
Top