Solved

Multiple pages in windows forms (windows Apps VS2008)

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

726 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