Solved

Multiple pages in windows forms (windows Apps VS2008)

Posted on 2008-06-15
4
1,002 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
4 Comments
 
LVL 85

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
DataGridView Events ? 3 37
Need to pass a connection through class/Method 1 39
Name space syntax error 12 41
Visual Studio TFS - how do I check in my code? 2 28
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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now