Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

load multiple forms into main form

Posted on 2006-05-26
10
Medium Priority
?
346 Views
Last Modified: 2012-05-05
is there a way with a panel or something to load forms into my main form

looking for a way to build individual forms and then load them into my main form when a menu option is selected
0
Comment
Question by:tpiazza
7 Comments
 
LVL 5

Expert Comment

by:mydasx
ID: 16771073
like a web usercontrol for asp.net but in winforms?  if you really want to get crazy w/ it, build custom controls homey.  then do  a visible invisible call.

However, i think the right answer is somewhat different.  Look at every major windows application you have ever used.  Did they implement window in window... no not really.  The windows application model is a dialog box model.  Where an application when needing further information will open a dialog and get its special data that way.  think of print preview, or save file etc.  these are complicated little buggers that get their own window who has control of the application only when he is needed.

mydasx
0
 

Author Comment

by:tpiazza
ID: 16771160
so instead of forms make them usercontrols?
0
 
LVL 5

Expert Comment

by:mydasx
ID: 16771186
right.  but, again i'd suggest, changing the model all together...  its like your trying to do web programming in the windows arena.  which where i'm from is a big no no...  but where youre from it may not be, so yes goto a usercontrol model
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:tpiazza
ID: 16771456
well im building an application with about 18 different forms -- want it to be seamless when they click on something-- all the forms are completely different

dont want to have to turn lots of controls on and off when they click on something -- any suggestions besides a usercontrol

also

how do i add the control at runtime?
0
 
LVL 5

Expert Comment

by:mydasx
ID: 16772128
personally, i use visible invisble and put them all on the form w/ a default setting.  Then create a method that toggles.
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 200 total points
ID: 16772670
Use a TabControl.

Here is an example of loading a form into a new TabPage in a TabControl:

        Dim sf As New SpeedoForm
        sf.FormBorderStyle = FormBorderStyle.None
        sf.TopLevel = False
        sf.Visible = True
        sf.Dock = DockStyle.Fill

        Dim tp As New TabPage
        tp.Controls.Add(sf)

        TabControl1.TabPages.Add(tp)
0
 
LVL 5

Expert Comment

by:maralans
ID: 16772817
Try this:

Q_21820327.html
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Integration Management Part 2
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question