MENUS AND DIALOG BOXES in .NET

Creation QR Code ISO/IEC18004 in .NET MENUS AND DIALOG BOXES

MENUS AND DIALOG BOXES
Quick Response Code Recognizer In .NET
Using Barcode Control SDK for .NET framework Control to generate, create, read, scan barcode image in .NET applications.
QR Maker In Visual Studio .NET
Using Barcode printer for VS .NET Control to generate, create QR Code image in .NET applications.
EXAMPLE 5.2 USING DROP-DOWN MENUS (GEOGRAPHY)
Reading Quick Response Code In .NET Framework
Using Barcode scanner for .NET Control to read, scan read, scan image in VS .NET applications.
Encode Barcode In .NET Framework
Using Barcode drawer for VS .NET Control to generate, create barcode image in .NET framework applications.
Fig. 5.4 shows the appearance of the Menu Editor for the application shown in Fig. 5.1. The first menu heading (i.e., menu name, as shown on the screen) is highlighted. Note that the Caption is Continents, and the Name is mnuContinents (note the prefix mnu to identify the menu item, as recommended by Microsoft and discussed in Sec. 4.4). Remember that the Name does not appear on the screen; it is used as a menu item identifier in Visual Basic program statements. Many (but not all) of the menu items are shown in the large area at the bottom of the Menu Editor. (Note the vertical slide bar, which provides access to all of the menu items.) The indentation defines the menu items that are grouped beneath each heading. Note the four ellipses (....) preceding each indented item. Pressing the right-arrow key for each menu item causes the ellipses to appear automatically.
Bar Code Decoder In .NET
Using Barcode recognizer for VS .NET Control to read, scan read, scan image in .NET applications.
Denso QR Bar Code Encoder In C#.NET
Using Barcode creator for VS .NET Control to generate, create QR Code image in Visual Studio .NET applications.
Fig. 5.4
Quick Response Code Creator In .NET
Using Barcode maker for ASP.NET Control to generate, create QR Code image in ASP.NET applications.
QR Code JIS X 0510 Maker In Visual Basic .NET
Using Barcode generator for .NET Control to generate, create QR Code JIS X 0510 image in .NET framework applications.
The complete list of menu items (captions and names) is shown below. Caption
Generate Bar Code In VS .NET
Using Barcode creator for Visual Studio .NET Control to generate, create barcode image in Visual Studio .NET applications.
Creating Code 128 In Visual Studio .NET
Using Barcode creator for .NET framework Control to generate, create Code 128 Code Set C image in .NET framework applications.
Continents ....Africa ....Antarctica ....Asia ....Australia ....Europe ....North America ....South America Oceans ....Arctic ....Atlantic ....Indian ....Pacific
EAN13 Printer In .NET Framework
Using Barcode generator for VS .NET Control to generate, create GS1 - 13 image in .NET framework applications.
UPC Shipping Container Symbol ITF-14 Drawer In VS .NET
Using Barcode generation for .NET framework Control to generate, create UPC Case Code image in VS .NET applications.
mnuContinents mnuAfrica mnuAntarctica mnuAsia mnuAustralia mnuEurope mnuNorthAmerica mnuSouthAmerica mnuOceans mnuArctic mnuAtlantic mnuIndian mnuPacific
Linear Barcode Generator In VB.NET
Using Barcode generator for Visual Studio .NET Control to generate, create Linear 1D Barcode image in Visual Studio .NET applications.
Printing EAN / UCC - 13 In None
Using Barcode drawer for Online Control to generate, create EAN128 image in Online applications.
(Continues on next page)
Bar Code Generation In Java
Using Barcode printer for Java Control to generate, create barcode image in Java applications.
Printing UPC-A Supplement 2 In .NET Framework
Using Barcode creation for Reporting Service Control to generate, create UPCA image in Reporting Service applications.
AM FL Y
Creating UPC-A Supplement 5 In Java
Using Barcode printer for Android Control to generate, create UPC-A Supplement 5 image in Android applications.
Code 128C Generator In Visual Basic .NET
Using Barcode maker for Visual Studio .NET Control to generate, create Code 128 Code Set B image in Visual Studio .NET applications.
Name
Draw EAN 128 In VB.NET
Using Barcode creation for VS .NET Control to generate, create EAN / UCC - 13 image in .NET framework applications.
Data Matrix 2d Barcode Drawer In Objective-C
Using Barcode creation for iPhone Control to generate, create Data Matrix image in iPhone applications.
Team-Fly
MENUS AND DIALOG BOXES
[CHAP. 5
Caption
Seas ....Baltic ....Bering ....Black ....Caribbean ....Mediterranean ....Persian Gulf ....Red ....South China
Name
mnuSeas mnuBaltic mnuBering mnuBlack mnuCaribbean mnuMediterranean mnuPersianGulf mnuRed mnuSouthChina
Execution of this program results in the availability of three drop-down menus. The first drop-down menu is shown in Fig. 5.1. Figs. 5.5(a) and (b) show the second and third drop-down menus.
Fig. 5.5(a)
Fig. 5.5(b)
Event procedures can be defined for each of the drop-down menu items. Typically, a click-type event procedure is associated with each menu item (but not the menu headings). To do so, simply double-click on each menu item within the Form Design Window, thus accessing the Code Editor Window. Then enter the appropriate instructions between the first (Sub) and last (End Sub) statements, as explained in Chap. 4.
5.2 ACCESSING A MENU FROM THE KEYBOARD A keyboard access character can be defined for each menu item. This allows the user to view a drop-down menu by pressing Alt and the access key for the menu heading, rather than clicking on the menu heading. In addition, once the drop-down menu is shown, the user may select a menu item by pressing its access key (without Alt) rather than clicking on the menu item. To define an access character, use the Menu Editor to place an ampersand (&) in front of the desired character within each menu item caption (i.e., within each screen name). The access character will then be underlined when the associated menu item is shown. Note that a drop-down menu must actually be visible on the screen for its access characters to be active. The first letter within the caption is often selected as the access character, but this need not be the case, particularly if the use of first letters would result in duplicate access characters among the labels or within a menu. In other words, each of the menu headings must have a unique access character. Similarly, each menu item within a menu must have a unique access character, though the same access character may be used (once) in each of two or more menus. In addition to access characters, we can also define keyboard shortcuts for some or all of the menu items within a drop-down menu. A keyboard shortcut is typically a function key, or a Ctrl-key combination or a Shift-
CHAP. 5]
MENUS AND DIALOG BOXES
key combination. Unlike an access character, which requires that a drop-down menu be displayed before it can be used, a keyboard shortcut can access a menu item directly without first activating the drop-down menu. Thus, a keyboard shortcut can be used to select a menu item directly from a window, saving several keystrokes or mouse clicks. Keyboard shortcuts are selected directly from the Shortcut field within the Menu Editor. Clicking on the down-arrow within this field displays the available choices. The keyboard shortcuts must be unique; that is, if a menu item (including menu headings) has an associated keyboard shortcut, it must be different from all other keyboard shortcuts. Remember, however, that keyboard shortcuts are not required; typically, they are defined only for the more commonly used menu items.
EXAMPLE 5.3 USING MENU ENHANCEMENTS (GEOGRAPHY REVISITED)
Let us now enhance the project shown in the last two examples by adding some additional controls, and by defining event procedures for the menu items. In addition, we will define an access character for each menu item, and, for illustrative purposes, a keyboard shortcut for some of the menu items. Specifically, we will add a label and a text box to the form, and we will display the area of a geographical feature (a continent, ocean or sea) within the text box if the feature is selected from a menu. In addition, we will add two command buttons, one to clear the text box, and the other to terminate the computation. The form design window is shown in Fig. 5.6. Note that the first letter of each menu heading is now underlined, indicating that it is a menu access character. Also, note the label Area (square miles): corresponding to Label1, the empty text box for Text1, and the command buttons labeled Clear (Command1) and Quit (Command2).
Copyright © OnBarcode.com . All rights reserved.