106 Part I Getting Started with Microsoft Visual Basic 2010
- Click the Time command.
The current system time appears in the label box, as shown here:
Now you’ll try displaying the current date by using the access keys on the menu.
- Press and release the ALT key, and then press the C key.
The Clock menu opens, and the first item on it is highlighted.
- Press the D key to display the current date.
The current date appears in the label box. However, if the box is not big enough,
the date might be truncated. If this happens, stop the program, resize the label object,
and try it again.
- When you’re finished experimenting, click the Close button on the program’s title bar
to stop the program.
Congratulations! You’ve created a working program that uses menus and access keys. In the
next exercise, you’ll learn how to use toolbars.
System Clock Properties and Methods
You can use various properties and methods to retrieve chronological values from the
system clock. You can use these values to create custom calendars, clocks, and alarms
in your programs. Table 4-1 lists the most useful system clock properties and methods.
For more information, check the topics “Dates and Times Summary” and “DateAndTime
Class” in the Visual Studio Help documentation.