Chapter 4 Working with Menus, Toolbars, and Dialog Boxes 105
This program statement displays the current date (from the system clock) in the Text
property of the Label1 object, replacing the previous Label1 text. The DateString
property is also available for general use in your programs. Assign DateString to the
Text property of an object whenever you want to display the current date on a form.
Note The Visual Basic DateString property returns the current system date. You can set
the system date by using the Clock, Language, and Region category in the Control Panel
of Windows Vista or Windows 7.
- Press ENTER to enter the line.
Your screen looks similar to this:
You’ve finished entering the menu demonstration program. Now you’ll save your
changes to the project and prepare to run it.
- Click the Save All button on the Standard toolbar, and then specify the
C:\Vb10sbs\Chap04 folder as the location.
Run the Menu program
Tip The complete Menu program is located in the C:\Vb10sbs\Chap04\Menu folder.
- Click the Start Debugging button on the Standard toolbar.
The Menu program runs in the IDE.
- Click the Clock menu on the menu bar.
The contents of the Clock menu appear.