Menu Commands

Program EasyDraw’s File menu contains six commands besides the MRU list: New, Open, Save, Save As, Close, and Exit. The code shown in Listing 9.4 manages these functions.

Subroutine FileIsLoaded sets the program’s controls to an appropriate state depending on whether a drawing is loaded. If no drawing is loaded, the subroutine disables the File menu’s Close, Save, and Save As commands. It also makes the toolbar and drawing area invisible. If a drawing is loaded, the subroutine enables the File menu’s commands and makes the toolbar and drawing area visible.

When the user selects the File menu’s New command, the mnuFileNew_Click event handler executes. It calls DataSafe to see if it safe to discard the current data and exits if ...

Get Visual Basic® .NET Database Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.