Solved

Multiple pages in windows forms (windows Apps VS2008)

Posted on 2008-06-15
4
998 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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 video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 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

19 Experts available now in Live!

Get 1:1 Help Now