![]() | |
|
|
|
To access the contents, click the chapter and section titles.
Advanced Visual Basic Techniques
When the system presents Windows 95 style help, the help topic appears in a popup. When the user clicks on the popup or on any other part of the screen, the popup disappears. Figure 2.8 shows ExpenseReporter displaying Windows 95 style context-sensitive help.
Because the popup disappears when the user clicks on it, the help topic presented should not contain hypertext jumps or other help popups. If the user tries to click on a hypertext link, the help popup will disappear rather than display the new topic. For this reason, context-sensitive help topics should be dead ends in the help topic file. They should provide no links to other topics, and they should not be part of browse sequences. Because the help is presented in a popup, the information it displays should be brief. It should not include a large title that will waste a lot of screen space. The user does not have the option of using links or other popups to define confusing terms, so the topic should be as self-contained as possible. Because context-sensitive help topics are so restricted, they generally are not useful as part of the normal screen-oriented help system. In that case, they should not have search keys either because there is little point in letting the user find these topics using the help programs search features. Instead, the help file should provide more complete screen-oriented entries that duplicate the context-sensitive entries. These topics can include hypertext links, popups, and search keys as usual. None of this needs to be true for Windows 3.x style help. Because this style of help presents topics in a full help application, links and help popups will work normally. These topics can include title text and keys, and they can be part of browse sequences. If a forms WhatsThisButton property is true and if its MinButton and MaxButton properties are false, Visual Basic adds a special question mark button to the windows title bar. In Figure 2.8, ExpenseReporter displays this button. When the user clicks on the Whats This button, the mouse help.pointer turns into a question mark. If the user then clicks on a control, Visual Basic presents the context-sensitive help for that control.
Unfortunately, to display the Whats This button, the forms MinButton and MaxButton properties must be false. That means the user cannot easily minimize and maximize the form. Fortunately, there is another way an application can display the Minimize and Maximize buttons and present context-sensitive help without using the Whats This button. A controls ShowWhatsThis method presents the context-sensitive help for that control. To present the help for a text box named IDText, an application could use the following statement: IDText.ShowWhatsThis An application can use ShowWhatsThis to display the context-sensitive help for fields in a program-specific manner. For example, the program could set a forms KeyPreview property to true and examine key presses. When the user pressed F1, the program could identify the control that currently held the input focus and invoke that controls ShowWhatsThis method. A forms WhatsThisMode method provides an even better solution. This method puts the form in Whats This mode just as if the user had pressed the Whats This button. The mouse cursor changes to a question mark, and the system presents help when the user clicks on a control. An application can use this method to effectively replace the Whats This button. The program should include a command button on the form or a command in a menu to start Whats This mode. The button or commands Click event handler invokes WhatsThisMode as in the following code:
Private Sub mnuHelpWhatsThis_Click()
WhatsThisMode
End Sub
Displaying About Dialogs and Splash ScreensThe one standard Help menu entry that is different from the rest is the About command. This command presents a dialog box that gives the name and version of the application. It often contains brief copyright information and sometimes identifies the registered owner of the application. The dialog contains an OK button that allows the user to close it at any time. A splash screen is a form that appears when the user first starts the application. It contains the same information as an about dialog. The only difference is that the splash screen remains visible for a certain amount of time, generally two or three seconds, and then disappears on its own when the application is ready to begin work. The user does not need to press an OK button, and the splash screen does not provide one. An application can use the same dialog both as an about dialog and as a splash screen. The application should include a form with a timer control and an OK button, as shown in Figure 2.9. The forms BorderStyle property should be set to 3 (Fixed Dialog) so that the user cannot resize the form. Its ControlBox, MinButton, and MaxButton properties should all be false because these options are not necessary on an about dialog or splash screen. The form should contain the applications name and version number, copyright information, and colorful, eye-catching graphics. The splash screen is the first thing the user will see when the application startsit should make a good impression. Next, the form should provide a Boolean AboutDialog property let function. The main application will invoke this function to tell the form whether it is being used as an about dialog or as a splash screen. The AboutDialog code presented later prepares the form appropriately.
|
|
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.
|