 TESTHELP Control Table of Contents

What is this thing?

How do I use this the TESTHELP Control?

TESTHELP Properties

References:

Q141871 "INF:  How to Add Tooltips to OLE Custom Controls"

Microsoft Knowledge Base Article

Denning, Adam. OLE Controls Inside Out

Microsoft Press, 1995

Brockschmidt, Kraig. Inside OLE

Microsoft Press, 1995


No Help Available

No help is available for this area of the window.


No Help Available

No help is available for this message box.

<< If you wish to author help specific to each message box prompt, then remove the AFX_HIDP_xxx values from the [ALIAS] section of your .HPJ file, and author a topic for each AFX_HIDP_xxx value. For example, AFX_HIDP_INVALID_FILENAME is the help topic for the Invalid Filename message box. >>


TestHelp Control
What Is This Thing?

This is a sample OCX control that demonstrates how to use the help files generated for you by the Microsoft Developer Studio Control Wizard. This sample OCX also demonstrates how to use tooltips in an OCX control. At runtime, the control is capable of displaying a tooltip for itself and showing help for itself in response to help messages being sent to it, usually as a result of the user pressing F1 while the control has the focus. The control just displays 3 strings in its client area. The text for these strings is entered in the General  property page for this control. OCX controls can be embedded in a client application to perform some specific task. Using OCX controls, a developer can add functionality to their program simply by embedding an OCX control, saving them from having to actually write the code required to add the desired functionality to their program.

This control also enables the Help button for the container's properties dialog box if it is supplied by the container. Pressing the property dialog help button will display this help file.


TestHelp Control
How Do I Use This Thing?

To use this OCX control, embed it in an application that supports the use of OCX controls. Microsoft Visual Basic applications and applications created with the Microsoft Developer Studio's AppWizard can support the use of OCX controls. You can change the properties of this control during design time to affect how the control will use help and tooltips during runtime.

There are two files required to use this control. They are:

•	TESTHELP.HLP  The help file for this control.

•	TESTHELP.OCX  The TESTHELP controls code and data.

Before you can use this control on a system it needs to be registered in the system registry. This is a self registering control. This means that to register the control in the system registry you only need to have an application load the control and call the control's exported function DllRegisterServer. You can use the REGSVR32 utility or have your setup program do this.


TestHelp Control
Properties

To change the properties of this control during design time, invoke your development environment's properties dialog for this control. You will be presented with three property pages for the control. The General tab is where you will select how help will be used for this control. The Colors tab will let you select colors to be used for this control. The fonts tab will let you select what font will be used for text in this control.

Here's some help on the properties of this control:

Name1

Name2

Name3

Type of Help to Use

Use Control's Help File

Use ToolTip for this Control


TestHelp Control
Name1

This is the first name in the list of names displayed in this control. Name1 will be displayed at the top of the list.


TestHelp Control
Name2

This is the second name in the list of names displayed in this control. Name2 will be in the middle of the list.


TestHelp Control
Name 3

This is the third name in the list of names displayed in this control. Name3 will be displayed at the bottom of the list.


TestHelp Control
Type of Help to Use

Help in a Popup Window

With this type of help selected, if a user presses F1 while the Testhelp control has the focus, help will be displayed for the control in a popup window.

Show the Whole Help File

With this type of help selected, if a user presses F1 while the Testhelp control has the focus, the contents page will be displayed in the main Windows help window.


TestHelp Control
Use Control's Help File

Setting this property will cause this control to respond to help messages by displaying help information from the TESTHELP.HLP file. If this option is not checked, this control will not respond to help messages.

Special note for Visual Basic Users:

If the Visual Basic form in which this control is embedded uses WhatsThisHelp and you want to use the help from this control's help file when the user clicks the WhatsThisHelp icon on this control, simply enable WhatsThisHelp for the form in the normal fashion but make sure the WhatsThisHelp ID for this control is 0. In the General property page for this control, check the Use Control's Help File option. When the user clicks the WhatsThisHelp icon on this control, help from the TESTHELP.HLP file will be displayed in the selected mode (popup or full window).


TestHelp Control
Use ToolTip for this Control

With this option selected, when the user lets the mouse pointer linger over the TESTHELP control, a tooltip will be displayed for the control. The tooltip's text will be whatever the user enters into the ToolTip Caption edit box.