120 likes | 210 Views
Review for Mid-term!. October 26, 2009. Review Homework Worksheet. True or False Operators are symbols that perform specific operations in Visual Basic statements . True or False Text boxes are fields on a form that allow the user to enter a value.
E N D
Review for Mid-term! October 26, 2009
Review Homework Worksheet • True or False Operators are symbols that perform specific operations in Visual Basic statements. • True or False Text boxes are fields on a form that allow the user to enter a value. • True or False Text boxes store user input in a numeric format. • True or False The backslash character is used for integer division. • True or False The Val function truncates the fractional part of a number. • True or False In Visual Basic an expression cannot take up more than one line.
List the seven mathematical operators covered in today’s lesson. = Assignment * Multiplication + Addition - Subtraction / Division \ Integer Division Mod Modulus (for remainder) • What are the differences between the forward slash and backslash? The forward slash (/) is used for normal divison and the backslash (\) is used for integer division • Which operator returns the remainder of integer division? The Mod or Modulus operator • Which character is used as the line-continuation character? The Underscore ( _ )
Using Multiple Forms • VB allows you to work with multiple forms! • Common uses are: • Dialog boxes (appears in Windows) • Splash Screens (is a window that appears briefly when a program is started.) • About boxes (is a window that provides information about the program.) • Or just simply another form!
Adding another form Complete the following steps: • Open VB. • Open your project. • Add a command button similiar to the one below:
Right click on Form1 in the Project Explorer. • Choose Add and than choose Form. See below:
Choose Form and click Open. See below: • You should see another form on your screen. Form 2
Double click the Next Page command button on Form1. • Enter the following code to display Form2 when press and Form1 disappears. Form2.Show Form1.Hide • Run your program. Do you get Form2 when you click the button?
How do you get to back to the first form? • On Form2 enter a command button. • Double click the Back button and enter the following code: Form1.show Form2.hide • Run your program. Is it working correctly?
Having problems seeing the correct form when you run your program? Setting Project Properties: 1. Right click on Forms in Project Explorer.
You should get: • Make sure that in the Startup Object box you have Form1. • Your program should work now!
Continue working on your Halloween Program! Due in 4 days......