Presentation on theme: "Using Multiple Forms! Creating a Splash Screen. Uses of Multiple Forms Includes: Dialog Boxes (appear often in Windows Programs) Splash Screen (a window."— Presentation transcript:
Uses of Multiple Forms Includes: Dialog Boxes (appear often in Windows Programs) Splash Screen (a window will appear briefly) About Boxes (window that provides information about program)
Definitions Splash Screen: A window that appears briefly when a program is started. Example: Microsoft Word have a splash screen that appears briefly while the program makes itself ready for use. About Box: A window that provides information about the program. Examples: Includes information like a registration number, version number, copyright, and information about the developer of the software.
Step-by-Step 1.Start Visual Basic. Watch closely to see the splash screen that appears as Visual Basic loads. 2. The New Project dialog box that appear when you start Visual Basic is a good example of a dialog box. Click the Cancel button to remove the dialog button to remove the dialog box.
3.Choose About Microsoft Visual Basic from the Help menu. An About box opens as shown. 4. Click the OK button and the About box closes.
Setting Project Properties The Project Properties dialog box allows you to set many options regarding the way your program is compiled and run.
1.Open Patterns from the hard drive (lesson 11). 2.Run the program using various values in the three fields and clicking the Create Pattern button. Hint: the program runs best with values under 6. If the Create Pattern button becomes disabled, click the clear window button. 3.End the program
4.Choose Patterns Properties (or choose Project 1 Properties) from the Project menu. 5.Click the Make tab. 6.In the Version Number frame, change the zero in the Minor text box to one. 7.In the application frame, change the Title to Pattern Demonstrator
Adding a Splash Screen 1.Choose Add Form from the Project menu. 2.Select the Splash Screen icon from the dialog box and click the Open button.
3.Leave the image in place, but delete all of the labels except for the Product label and the Version label. 4.Change the font size of the Product label to 18 point. 5.Run the Program. The splash screen does not appear. Why?
To get the splash screen you created to appear, you have to tell the project that you want to start with the splash screen form. You also have to code the splash screen to ensure that the correct form opens when the splash screen closes.
1.Choose Patterns Properties from the Project menu. 2.In the General section of the dialog box, choose frmSplash as the Startup Object. 3.Click the OK button. 4.If necessary, double-click the splash screen form in the Project Explorer window to open the splash screen. 5.Double-click the center of the splash screen form and enter the following code:frmPattern.Show
6.You will also need to enter code to make your form close. Locate the event procedure named Frame1_Click. Add the following: frmPattern.Show 7. Run your program!
Adding an About Box Choose Add Form from the Project menu. The Add Form dialog box appears. Select the About Dialog icon from the dialog box and click Open.
Delete the label that has the caption that begins with Warning: Change the caption of lblDescription (the one that has the caption of App Description) to the following: This program demonstates how ForNext Loops can be used to create patterns of letters.
Close frmAbout. Make sure the main from (frmPattern is open). Double-click the About button. Add the following code: frmAbout.Show Close the code window and run the program. Fix and bugs and call me when you are finished and I’ll check your program into my book!
Your assignment: Create a splash screen and an About box for the NestedFor project you worked on in class last week. You can decide whether you want to modify all the label control captions on the splash screen form or delete the labels that you don’t need. Keep in mind the following items when completing this activity: 1. You will need to change the version number of the program. 2. You will need to create an About button on the form. 3.You will need to type a description of the program in the lblDescription label of the About form.