resizing a panel (VS2003)

H

herc

I am drawing a blank here, I have a feeling the solution is beyond
simple, it simply escapes me...

I have a .Net 1.1 form that has a lot of controls on it. Two of the
controls (actually 8 controls are involved total) are list boxes. The
total height of both controls is determined at run time by the form
size. The objective is to make both list boxes 50% of the space.

I say 8 controls because how I have it laid out right now is this:

Main panel contains:
+ Top panel (w/ label and list box) --> Dock: Top
+ Spliter
+ Bottom Panel ( w/ label and listbox) --> Dock: Fill

In .Net 2.0 I would simply use a table control and be done with it,
but it doesn't look like I have that control in .Net 1.1. What is the
best way to make the top panel half the height of the bottom panel?
Also, it is sizable by the user, what is the best approach to
preserving the split location?

Cartoper
 
H

herc

I am drawing a blank here, I have a feeling the solution is beyond
simple, it simply escapes me...

I have a .Net 1.1 form that has a lot of controls on it. Two of the
controls (actually 8 controls are involved total) are list boxes. The
total height of both controls is determined at run time by the form
size. The objective is to make both list boxes 50% of the space.

I say 8 controls because how I have it laid out right now is this:

Main panel contains:
+ Top panel (w/ label and list box) --> Dock: Top
+ Spliter
+ Bottom Panel ( w/ label and listbox) --> Dock: Fill

In .Net 2.0 I would simply use a table control and be done with it,
but it doesn't look like I have that control in .Net 1.1. What is the
best way to make the top panel half the height of the bottom panel?
Also, it is sizable by the user, what is the best approach to
preserving the split location?

This seems to work:

int targetHeight = this.pnlVisitView.Height / 2;
panelVisits.Height = targetHeight - splitterVisitView.Height;
panelViews.Height = targetHeight;
panelViews.Top = targetHeight;
 

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