Share via


Visual Basic Concepts

Designing a User Assistance Model

No matter how great your user interface, there will be times that a user needs assistance. The user assistance model for your application includes such things as online Help and printed documentation; it may also contain user assistance devices such as ToolTips, Status Bars, What's This help, and Wizards.

The user assistance model should be designed just like any other part of your application: before you start developing. The contents of your model will vary depending on the complexity of the application and the intended audience.

Help and Documentation

Online Help is an important part of any application — it's usually the first place a user will look when they have a question. Even a simple application should provide Help; failing to provide it is like assuming that your users will never have questions.

In designing your Help system, keep in mind that its primary purpose is to answer questions. Try to think in terms of the user when creating topic names and index entries; for example, "How do I format a page?" rather than "Edit, Page Format menu" will make your topic easier to locate. Don't forget about context sensitivity; it's frustrating to most users if they press the F1 key for help on a specific field and find themselves at the Contents topic.

Conceptual documentation, whether printed and/or provided on compact disc, is helpful for all but the simplest applications. It can provide information that may be difficult to convey in the shorter Help topic. At the very least, you should provide documentation in the form of a ReadMe file that the user can print if desired.

User Assistance Devices

Within the user interface, there are several techniques for providing assistance to the user. Visual Basic makes it easy to add ToolTips, What's This help, Status displays, and Wizards to your applications. It's up to you to decide which of these devices are appropriate for your application.

ToolTips

ToolTips (Figure 6.23) are a great way to display information to the user as they navigate the user interface. A ToolTip is a small label that is displayed when the mouse pointer is held over a control for a set length of time, usually containing a description of the control's function. Normally used in conjunction with toolbars, ToolTips also work well in most any part of the interface.

Figure 6.23   A ToolTip for the Visual Basic toolbar

Most Visual Basic controls contain a single property for displaying ToolTips: ToolTipText. The following code would implement a ToolTip for a command button named cmdPrint:

cmdPrint.ToolTipText = "Prints the current document"

As with other parts of the interface, make sure that the text clearly conveys the intended message to the user.

For More Information   To learn more about ToolTips, see "ToolTipText Property" in the Language Reference.

What's This Help

What's this Help provides a link to a pop-up Help topic (see Figure 6.24) when the user selects What's This Help and clicks the What's This cursor on a control. What's This Help can be initiated from a toolbar button, a menu item, or a button on the title bar of a dialog box.

Figure 6.24   A What's This Help pop-up window

To enable What's This Help from a menu or toolbar

  1. Select the control for which you wish to provide help .

  2. In the Properties window, select the WhatsThisHelpID property.

  3. Enter a context ID number for the associated pop-up Help topic.

  4. Repeat steps 1 through 3 for any additional controls.

  5. Select the form.

  6. In the Properties window, set the Form's WhatsThisHelp property to True.

  7. In the Click event of the menu or toolbar button, enter the following:

    formname.WhatsThisHelpMode
    

    When the user clicks the button or menu, the mouse pointer will change to the What's This pointer.

To enable What's This Help on the title bar of a custom dialog form, set the form's WhatsThisButton and WhatsThisHelp properties to True.

For More Information   To learn more about What's This Help, see "WhatsThisHelp Property" and WhatsThisButton Property" in the Language Reference.

Status Displays

A status display can also be used to provide user assistance in much the same way as a ToolTip. Status displays are a good way to provide instructions or messages that may not fit easily into a ToolTip. The status bar control included in the Professional and Enterprise editions of Visual Basic works well for displaying messages; a label control can also be used as a status display.

The text displayed in a status display can be updated in one of two ways: in the GotFocus event of a control or form, or in the MouseMove event. If you want to use the display as a learning device, add an item to the Help menu to toggle its Visible property on and off.

To add a status display

  1. Add a label control to your form.

  2. Select the control for which you wish to display a message.

  3. Add the following code to the control's MouseMove (or GotFocus) event:

    Labelname.Caption = "Enter the customer's ID number in this field"
    

    When the user moves the mouse over the control, the message will be displayed in the label control.

  4. Repeat steps 2 and 3 for any additional controls.

Wizards

A wizard is a user assistance device that takes the user step by step through a procedure, working with the user's actual data. Wizards are usually used to provide task-specific assistance. They help a user accomplish a task that would otherwise require a considerable (and undesirable) learning curve; they provide expert information to a user that has not yet become an expert.

The Professional and Enterprise editions of Visual Basic include the Wizard Manager, a tool for creating wizards.

For More Information   To learn more about wizards, see "Using Wizards and Add-Ins" in "Managing Projects."