Solved

Multiple pages in windows forms (windows Apps VS2008)

Posted on 2008-06-15
4
1,012 Views
Last Modified: 2013-11-26
Hi there

I am new to making windows apps with VS2008 (have experience with web apps).

How would I make an app have multiple pages without using a new form window.

For example, I have two buttons on my windows app - read details and enter details: I want to display different layouts/textboxes etc. for each 'page'.

I have so far managed this with panels and setting them to hide and unhide on user clicks but it is almost impossible to work with this is VS as there is no way to hide the panels (that I can find) in design mode. So if I am working with 10 pannels it gets very messy and confusing.

I have also used 'tabs' to create individual pages but I dont want a tabbed layout.

Many thanks in advance.
0
Comment
Question by:garethh86
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 250 total points
ID: 21789555
You can design each "page" as a seperate FORM and then load them into a Panel using code like this:
        Dim f2 As New Form2
        f2.TopLevel = False
        f2.Dock = DockStyle.Fill
        f2.FormBorderStyle = Windows.Forms.FormBorderStyle.None
        Me.Panel1.Controls.Add(f2)
        f2.Show()

Open in new window

0
 
LVL 34

Assisted Solution

by:Sancler
Sancler earned 250 total points
ID: 21789986
Another idea - I'm only throwing this in because you say you're new to WinForms - is an MDI (multiple document interface) approach.  In that your app has a main form, which acts as the parent container of other, child forms.  Then each of your "pages" could be a separate child form.

Roger
0
 
LVL 1

Expert Comment

by:cherrera2001
ID: 21808787
Generally I would try to create one Windows form, and then create multiple User Controls. This way you can add and remove the controls dynamically from the form, and you still get the benefit of the designer for control layout.
0
 
LVL 1

Expert Comment

by:jpadkins49
ID: 21819005
One way to accomplish this if you do not want to open new forms or utilize and MDI approach is to use a TabStrip or the FatTabStrip in the Visual Basic Power Packs 3.0 . This would allow you to add multiple controls to the same form and save some valuable real estate on your application.

0

Featured Post

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

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

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

688 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