Beruflich Dokumente
Kultur Dokumente
Access keys
Shortcut keys
Check box
The Application Wizard is a straightforward tool for building a new application. This means that the Application Wizard is used to build a functional application shell with standard features. If you want additional features, you have to program them yourself or use the Menu Editor to add them. After you click Finish in the Application Wizard and the base program is generated, you're on your own to make changes to the program by using the Menu Editor
6. In the last dialog, you can save your profile Enter a name for your profile that will be easy to relate to your application. After you enter the name, choose Finish to complete the Application Wizard. (Clicking Finish on any of the earlier dialogs in the wizard bypasses the option to save the profile for future use.)
Don't press Enter yet! Press Tab or use the mouse to move between text boxes in the Menu Editor; otherwise, you cause the Menu Editor to create a new menu item.
Using ampersands Including an ampersand in the menu caption forces the character that comes after it to be underlined when it appears in the menu. The underlined character becomes the hot key, which users can press (combined with the Alt key) to make a selection. For example, with the F underlined on the File menu, users can press Alt+F to pull down that menu
2. Open the Menu Editor by clicking the Menu Editor button on the Standard toolbar. If the form doesn't have the focus, the Menu Editor icon is grayed out. 3. In the Menu Editor dialog, type &File in the Caption text box and mnuFile in the Name text box. Click Next. 4. Click the button with the arrow pointing to the right. This is the indent button.
5. Type E&xit in the Caption text box and itmExit in the Name text box. Your menu should appear in the dialog as shown in Figure 13.6. 6. Click OK. 7. The menu you created is embedded in the form Drop down the File menu that you just created and click Exit. The code window for the itmExit_Click() event procedure appears. 8. Add the Unload Me statement to the itmExit event procedure 9. Press F5 to run the code
You then enter identifiers for the Caption and Name for each menu item. (The Caption is actually the screen name of the item, as it appears in the Menu Bar or within the dropdown menu. The Name is used only in Visual Basic code it is not displayed when the application is running.) The Caption will appear in the large area at the bottom of the Menu Editor as well as within the Caption field. You may either press the Enter key or click on the Next button after the information has been entered for each menu item.
The menu headings must be flush left within each line. Items that appear within each menu must be indented one level, as indicated by four ellipses preceding each item. The indentation is accomplished using the right-arrow button. Click once to indent one level (four ellipses). The opposite action, i.e., moving an indented item to the left, is accomplished with the leftarrow button. The relative ordering of each menu component can be altered using the up- and down-arrow buttons. Thus, to move an entry ahead of the two preceding entries, highlight the entry to be moved and click on the up-arrow button twice. In addition, a menu component can be inserted by highlighting the item that will appear below the insertion, and clicking on the Insert button. Similarly, a menu component can be deleted by highlighting the component and clicking on the Delete button. Remember that it is the indentation pattern that distinguishes the menu heading from the corresponding items in the drop-down menu. Also, it is the order of the entries that distinguishes one set of menu components from another. (This may sound more complicated than it really is, as shown in the following example.)
Value/Type Description String Boolean Boolean String The text that appears on the menu bar. Puts a check mark before the Caption string of a menu item. Doesn't gray out the Caption string if True.
The name of the object--available only at design time. Value/Type Description N/A A key combination that allows you to access the menu item's functionality. You can choose this setting only at design time from a list that appears in the Shortcut drop-down list in the Menu Editor. Makes a top-level menu in an MDI form display a list of windows open in that MDI form-available only at design time.
WindowList
Boolean
SUBMENUS
A menu item may have a submenu associated with it. Placing the mouse over the menu item
The value returned by the MsgBox function will depend upon the particular command button selected by the user during program execution. The possible values are summarized below.
string variable = Input Box(prompt, title, default) The first argument (prompt) represents a string that appears within the dialog box as a prompt for input. The second argument (title) represents a string that will appear in the title bar. Its default value (if not included as an explicit argument) will be the project name. The last argument (default) represents a string appearing appearing initially in the input boxs text box. The default string will be empty if this last argument is not included in the function reference.
Private Sub Command1_Click() Dim CustomerName As String, L1 As String, L2 As String Dim AcctNo As Integer, Verify As Integer L1 = "Customer Name: " L2 = "Account Number: " Do Label1 = L1 Label2 = L2 CustomerName = InputBox("Please enter your name:", "Customer Name") Label1 = L1 & CustomerName AcctNo = Val(InputBox("Please enter your account number:", "Account Number")) Label2 = L2 & Str(AcctNo) 'Process the account
Verify = MsgBox("Is this correct?", 3, "Verify") Loop While Verify = 7 If Verify = 2 Then Label1 = L1 Label2 = L2 End If End Sub Private Sub Command2_Click() End End Sub