home account info subscribe login search FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Advanced Visual Basic Techniques
(Publisher: John Wiley & Sons, Inc.)
Author(s): Rod Stephens
ISBN: 0471188816
Publication Date: 06/01/97

Search this book:
 
Previous Table of Contents Next


Some applications use a Quit (Ctrl-Q) command to exit the application. Some even use Quit to mean “quit the application immediately” and the Exit command to mean “save the current document and then quit.” These commands have gone out of style, so new applications should stick with the Exit command described previously. Creatively changing the meanings of common commands can cause nothing but headaches for both developers and users.

Edit The Edit menu contains commands that modify the current document. These include copy, paste, and undo. The Find (or Search) command does not modify the document, but the Replace command does. Because the two commands go together, Find and Replace belong in the Edit menu.

Figure 1.10 shows an Edit menu. The standard mnemonic for the Edit menu is the letter E. Standard entries in the Edit menu are listed below.

Undo (Ctrl-Z). Undoes the previous editing command. A program can implement undo in many ways. Some programs simply undo the previous command. Others then allow the user to activate a Redo command to undo the undo. Still other programs keep a long list of previous commands so the user can undo and redo many commands in the list. These methods give the user more flexibility, but they are harder to implement. Some programs use Alt-Backspace as the accelerator for undo.
Redo (Ctrl-Y). Repeats the command just undone using undo. Programs that use Alt-Backspace as the undo accelerator use Alt-Return as the redo accelerator.
Repeat (Ctrl-R). Repeats the previous command. For example, suppose a word processing application changes the formatting on a paragraph so it is indented. If the user then moves the cursor to the next paragraph and presses Ctrl-R, the application should indent that paragraph in a similar fashion. This can be a very useful command, but it can also be tricky to implement and, depending on the application, it can be hard for the user to understand.


FIGURE 1.10  An Edit menu.

Cut (Ctrl-X). Copies the currently selected objects to the clipboard and removes them from the document. The Paste command can later retrieve the objects from the clipboard. Visual Basic text boxes and some other controls implement cut, copy, and paste with no extra work from the application developer. If an application deals only with text, these commands are not needed in the Edit menu. These commands are more important for graphic applications where the user might want to cut an object from one document and paste it into another. Some applications use Shift-Delete as the Cut accelerator.
Copy (Ctrl-C). Copies the currently selected objects to the clipboard and leaves them in the document. Applications that use Shift-Delete as the Cut accelerator use Ctrl-Ins as the Copy accelerator.
Paste (Ctrl-V). Retrieves whatever objects are available in the clipboard and inserts them into the current document. Applications that use Shift-Delete as the Cut accelerator use Shift-Ins as the Paste accelerator.
Delete (Delete). Removes the currently selected object from the document. Some programs call this command Clear. Visual Basic text boxes and other controls normally delete text when the user selects it and presses the Delete or Backspace key. If an application uses Delete as a menu accelerator, Visual Basic controls cannot perform their normal functions. This is similar to the way copy, cut, and paste do not work normally if an application uses Ctrl-C, Ctrl-X, and Ctrl-V as accelerators. For this reason, most applications should not use Delete as an accelerator.
Duplicate (Ctrl-D). Creates a copy of the currently selected objects and adds them to the document. This command is similar to copy followed by paste, though it does not leave a copy of the objects in the clipboard for later pasting. Because the user can use copy and paste, this command is necessary only in applications where it will probably be used frequently.
Select All (Ctrl-A). Selects all of the objects in the document. For example, the user could then copy them all to the clipboard using the Copy command.
Find (Ctrl-F). Presents a dialog that allows the user to enter text. The application then finds and highlights the text. Some programs use F3 for the accelerator. Many programs provide search options such as matching complete words only (so “act” does not match “reactor”), requiring an exact case match (so “fish” does not match “Fish”),and so on.
Find Again (F3). Finds and highlights the next occurrence of the text previously found by Find. Some programs call this command Find Again. If the program uses F3 as the Find accelerator, it cannot use F3 as an accelerator for the Find Next command. Most programs in this situation require the user to reopen the Find dialog. The dialog will contain the previously entered search value so the user can simply press the OK button or the return key to find the text again. Some applications keep the dialog visible until the user closes it, allowing the user to perform several searches in succession.
Replace (Ctrl-H). Presents a dialog that allows the user to enter text to be found and a replacement value. The dialog usually allows the user to verify each replacement or to make all possible replacements automatically. Some programs include replacement options on the Find dialog and do not have a separate Replace command. Some applications preserve the case of the replaced text. For example, while replacing “text” with “string,” the program would replace “Text” with “String” and “TEXT” with “STRING.”

View The View menu contains commands that change the user’s view of the data without changing the actual data values. Commands may change the scale at which the data is viewed, the filter used to select the types of data displayed, or the ordering of the data.

Commands that determine which user interface components are present also belong in the View menu. For example, a command that allows the user to decide which toolbars are displayed belongs in this menu. Notice that there is some ambiguity here. One could also reasonably think of this sort of command as a configuration command that belongs in the Options menu, discussed in the next section.

Figure 1.11 shows a View menu. The standard mnemonic for this menu is V. Standard entries in the View menu are listed below.

Toolbar. Toggles toolbar display. The menu item’s Checked property indicates whether the toolbar is displayed. Applications that have many toolbars can display a dialog that allows the user to select the toolbars that should be visible all at once. An application that does this should add an ellipsis to the end of the command name. Other applications provide separate commands for activating each of the toolbars individually. These commands are placed as submenu items cascading from the Toolbar command.


FIGURE 1.11  A View menu.

Status Bar. Toggles status bar display. The menu item’s Checked property indicates whether the status bar is displayed.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-1999 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permision of EarthWeb is prohibited.