Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C# dotnet control panel placements

Status
Not open for further replies.

needscoop

Programmer
Nov 13, 2002
29
US
Can you control the location where a panel appears,
in relation to another panel?

Desired sceanrio:
I want 1 panel as a "header" panel whose width is 100%
the majority of the time. On some occasions there's
a 2nd panel I want to appear to the left of it, having
a width of 10% - I want the header panel's width to dynamically reduce to 90% (in conjunction with panel2
becoming visible). Both panels are the same height, and
they should appear adjacent to each other.


XXXXXXXXXXXXXXXXXXXXX <--- most the time just "header"


XX XXXXXXXXXXXXXXXXXX <--- sometimes want 2 panels

 
There is the splitter control and you can anchor the panels. Not sure to what extent you want these on the forms (whether you want them to interact somehow with each other of if you just want the left panel to appear sometimes, otherwise be invisable.
 
Make your left panel the 10% but make it invisible. Make your main panel DockStyle.Fill.

when you change your left panel .visible = true, it will automatically re-adjust.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top