Dela via


How to: Display Pop-up Help

One way to display Help on Windows Forms is through the Help button, located on the right side of the title bar, accessible through the HelpButton property. This type of Help display is well-suited for use with dialog boxes. Dialog boxes shown modally (with the ShowDialog method) have trouble bringing up external Help systems, because modal dialog boxes need to be closed before focus can shift to another window. Additionally, using the Help button requires that there is no Minimize button or Maximize button shown in the title bar. This is a standard dialog-box convention, whereas forms usually have Minimize and Maximize buttons.

Be aware that you can also use the HelpProvider component to link controls to files in a Help system, even if you have implemented pop-up Help. For more information, see Providing Help in a Windows Application.

Note

The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Working with Settings.

To display pop-up Help

  1. Drag a HelpProvider component from the Toolbox to your form.

    It will sit in the tray at the bottom of the Windows Forms Designer.

  2. In the Properties window, set the HelpButton property to true. This will display a button with a question mark in it on the right side of the title bar of the form.

  3. In order for the HelpButton to display, the form's MinimizeBox and MaximizeBox properties must be set to false, the ControlBox property set to true, and the FormBorderStyle property to one of the following values: FixedSingle, Fixed3D, FixedDialog or Sizable. For more information on working with borders and the Minimize and Maximize buttons, see How to: Change the Borders of Windows Forms Using the Designer.

  4. Select the control for which you want to show help on your form and set the Help string in the Properties window. This is the string of text that will be displayed in a window similar to a ToolTip.

  5. Press F5.

  6. Press the Help button on the title bar and click the control on which you set the Help string.

See Also

Concepts

Control Help Using ToolTips

Other Resources

Integrating User Help in Windows Forms

Windows Forms