Display Context-Sensitive Help

Problem

You want to display a specific help file topic depending on the currently selected control.

Solution

Use the HelpProvider component, and set the HelpKeyword and HelpNavigator extender properties for each control.

Discussion

.NET provides support for context-sensitive help through the System. Windows.Forms.HelpProvider class. The HelpProvider class is a special extender control. You add it to the component tray of a form, and it extends all the controls on the form with a few additional properties, including HelpNavigator and HelpKeyword. For example, Figure 10-8 shows a form that has two controls and a HelpProvider named HelpProvider1. The ListBox1 control, which is currently selected, has several help-specific ...

Get Microsoft® Visual Basic® .NET Programmer's Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.