Working with Multiple Forms using Visual C# 2008 | Learnxpress

Working with Multiple Forms using Visual C# 2008

May 25th, 2009 Anand Narayanaswamy 1 Comment

You will need to work with more than one form while developing Windows based applications in C#. In this code snippet, Anand examines the steps required using Visual C# 2008

(1) Start Visual Studio 2008 (Start | All Programs | Microsoft Visual Studio 2008 | Microsoft Visual Studio 2008)

(2) Create a new C# project from File | New | Project. The New Project dialog box opens up as shown in Figure 1. Modify the project name and change the target directory if required.

Figure 1

Working with Multiple Forms using Visual C# 2008

(3) A new form with the title Form1 appears on the screen. Add a Button control to it from the Toolbox. Change the caption to OK by altering the Text property from the Properties window.

Figure 2

Working with Multiple Forms using Visual C# 2008

(4) Add another form to the project by selecting Add Windows Form item from Project menu. Add a Label control to it and change its text as “This is Form 2″

Figure 3

Working with Multiple Forms using Visual C# 2008

(5) Activate Form 1 by double clicking Form1.cs from Solution Explorer. Double click the Button control and add the following code

Form2 f2 = new Form2();
f2.Show();

Figure 4

Working with Multiple Forms using Visual C# 2008

(6) Run the project by pressing F5 key. You can also run by selecting Start Debugging item from the Debug menu.

Figure 5

Working with Multiple Forms using Visual C# 2008

 

If You Like This Post, Share it With Your Friends & Peers

Digg
stumbleupon
Delicious
facebook
twitter
reddit
rss feed bookmar
   

One Comment to “Working with Multiple Forms using Visual C# 2008”

  1. beginner says:

    Thanks a lot!!!

Leave your comment here:

Terms

  • c# 2008 open new form
  • Visual C# start form2 from form1
  • Visual C# 2008 info from one form to another
  • two forms c# 2008
  • visual c# multiple forms
  • opening multiple form in vs2008
  • c# multiple forms
  • visual c# 2008 form show
  • visual c# 2008 multi forms
  • visual studio multiple forms

  • show form in c# 2008
  • how to bind multiple forms in visual studio 2008
  • how to show a form in c# 2008
  • ph
  • multiple forms in visual c#
  • show another form c# vs 2008
  • work with visual c# 2008 forms
  • c# run multiples forms
  • multiple form visual studio
  • C# button form 2 2008
  • seo forum


Google Analytics Alternative