Solved

Multiple pages in windows forms (windows Apps VS2008)

Posted on 2008-06-15
4
1,006 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

773 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