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 / December 2005

Tip: Looking for answers? Try searching our database.

Panels design

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
M. - 09 Dec 2005 13:49 GMT
I have following situation:
On the righthand side of the form i have navbar and panel to the right.
Content of the panel is supposed to be different according to what user
chooses in the navbar.
How to do that at the moment of design.
How am I creating another panel with different content at the same place as
the previous one , what do I do with the previous content. Hide it??
I know that later i use the visibility option to dispay certain panels.
But how to acreate all of them at the same place in the designer??
Chris Dunaway - 09 Dec 2005 16:41 GMT
One option would be to only have one content panel.  Create each "page"
as a separate UserControl and place the rest of the content on the
Usercontrol.  Then, in response to the selection on the navbar,
instantiate and display the appropriate control and place it on the
panel.

You could also use Forms for this by setting the form's BorderStyle to
nothing and it TopLevel property to False.  Then set the Form's Parent
property to the Panel and Show the form and it will appear inside the
panel.
Mick Doherty - 10 Dec 2005 00:44 GMT
If you're using VS2003 (will probably work in VS2002 but I don't have a copy
to test it) then see the PanelManager Class on my site which was created
specifically for this:
http://www.dotnetrix.co.uk/custom.html

In VS2005 the class still works, but because of DesignTime Designer issues
(which MS are currently working on) the control needs to be built in a
seperate ControlLibrary solution and the control referenced via the created
dll. If the control is included as part of the solution, even if it's in a
seperate project, then the Panels Collection works Ok in the designer until
the project is rebuilt, at which time if you try to access the panels
collection you get an invalid cast exception due to the designer referencing
the pre build collection items instead of the current build items.

An alternative method, as Chris suggested, is to use UserControls and load
them dynamically at runtime.

Signature

Mick Doherty
http://dotnetrix.co.uk/nothing.html

>I have following situation:
> On the righthand side of the form i have navbar and panel to the right.
[quoted text clipped - 6 lines]
> I know that later i use the visibility option to dispay certain panels.
> But how to acreate all of them at the same place in the designer??

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.