Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / June 2007

Tip: Looking for answers? Try searching our database.

resizing a panel (VS2003)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
herc - 13 Jun 2007 22:14 GMT
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
herc - 14 Jun 2007 13:18 GMT
> I am drawing a blank here, I have a feeling the solution is beyond
> simple, it simply escapes me...
[quoted text clipped - 16 lines]
> 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;

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.