Hi,

I am using a HelpProvider in my .NET Windows Forms project and after a lot of searching I can not find any way to control where the popup that it creates is displayed.

Here is some example code,

HelpProvider helper = new HelpProvider();                      
            
helper.SetShowHelp(this.listBox, true);
                        
helper.SetHelpString(this.listBox, "Help text");

The user is able to then hit F1 when the control has focus and a popup containing the help text is displayed. However, this popup displays in seemingly random locations and the HelpProvider doesn't seem to have any methods to control where it displays. Sometimes it is even displaying below the Taskbar which is obviously a big issue.

Does anyone have a solution to this problem?

Thanks for any help.

I have never used this before but when I tried it the tooltip always showed up in the same place.
This place is however determined by the current mouse position meaning that it could be anywhere.
The help tooltip window is shown with its top centered where the mouse is when f1 is pressed.
Does anyone have any ideas about how to override this rather odd behaviour?

It seems (after googling) that most people are using this with a .chm file. Since this opens in a new form the issue of location is not a concern. I think this is why there is not much help out there for this problem.

Of course, the simplest way to do this is to drop the HelpProvider and implement the same thing using a ToolTip. Manualy capture the F1 key and manualy show the tooltip. A bit more work, but you will get control over the tooltip position.

I suppose I could do that, but I'd rather use the HelpProvider if possible.

It just seems very odd to me that a control is provided where you have so little control over its behavior.

Also, on my machine the location the help box opens is not anywhere near where the mouse cursor is. It does seem to depend on the mouse position, because its location changes when I move the mouse, but it seems to be related in some seemingly random way.

This article has been dead for over six months. Start a new discussion instead.