Visual Basic
Multiple Forms
2
Objectives
 Create multiple forms for a project.
 Use multiple forms to add an About
box to your program.
 Use multiple forms to create a Splash
screen that loads when your program
starts.
 Modify a form at run time.
3
Using Multiple Forms
 Visual basic .NET allows you to work
with multiple forms.
 A splash screen is a window that
appears briefly when a program is
started.
 An About box might include
information about the program.
4
Creating a New Form
 The first step in using additional forms in
your project is to create the new form.
 To get the About box to appear, some
command must be issued.
 A modal form must be dismissed before you can
continue working with the application.
 A modaless form can stay on the screen and be
moved behind other forms in a project .
5
Adding a Splash Screen
 Adding a splash screen is similar to
adding an About box.
 The splash screen must be loaded before
your main screen.
 Unlike an About box, a splash screen
does not have a command to close it.
6
Modifying a Form at Run Time
 Just as the objects on a form can be
modified while the form is being
displayed, form objects can also be
modified before the form is displayed.
7
Summary
 Visual Basic. NET programs can include
multiple forms. Splash screens and About
boxes are two common uses for additional
forms in a program.
 Modal forms must be closed before other
forms in a project can be used.
 Modaless forms can remain open, and a
program can switch back and forth between
several modaless forms.
8
Summary (continued)
 The Close method is used to shut down a
form and leave the program running.
 A program module that includes only code
can be used to control several forms.
 Forms can be created without any border
and placed in the center of the screen.
9
Summary (continued)
 The Property Pages dialog box lets you
select which form or module starts up the
program when it runs.
 The properties of a form and the object on
the form can be changed under program
control before the form is displayed.

VB Multiple Forms

  • 1.
  • 2.
    2 Objectives  Create multipleforms for a project.  Use multiple forms to add an About box to your program.  Use multiple forms to create a Splash screen that loads when your program starts.  Modify a form at run time.
  • 3.
    3 Using Multiple Forms Visual basic .NET allows you to work with multiple forms.  A splash screen is a window that appears briefly when a program is started.  An About box might include information about the program.
  • 4.
    4 Creating a NewForm  The first step in using additional forms in your project is to create the new form.  To get the About box to appear, some command must be issued.  A modal form must be dismissed before you can continue working with the application.  A modaless form can stay on the screen and be moved behind other forms in a project .
  • 5.
    5 Adding a SplashScreen  Adding a splash screen is similar to adding an About box.  The splash screen must be loaded before your main screen.  Unlike an About box, a splash screen does not have a command to close it.
  • 6.
    6 Modifying a Format Run Time  Just as the objects on a form can be modified while the form is being displayed, form objects can also be modified before the form is displayed.
  • 7.
    7 Summary  Visual Basic.NET programs can include multiple forms. Splash screens and About boxes are two common uses for additional forms in a program.  Modal forms must be closed before other forms in a project can be used.  Modaless forms can remain open, and a program can switch back and forth between several modaless forms.
  • 8.
    8 Summary (continued)  TheClose method is used to shut down a form and leave the program running.  A program module that includes only code can be used to control several forms.  Forms can be created without any border and placed in the center of the screen.
  • 9.
    9 Summary (continued)  TheProperty Pages dialog box lets you select which form or module starts up the program when it runs.  The properties of a form and the object on the form can be changed under program control before the form is displayed.