Why is Help.ShowHelp a modal window?

G

Guest

If you open help using Help.ShowHelp() call, the window that opens is a modal
window, and always stays on top of your parent window.

I tried opening the "mspaint.chm" from a sample app, and that opened up in a
modal window; however the MS Paint app opens up the same file in a non-modal
window.

Is there any way to open in help a non-modal window from a .Net app?
 
R

Rodger Constandse

Hi,

What I do is create a "Help Host" form and then use that as the parent in the
ShowHelp call. I keep this form around in a member variable of my "Application"
class and use it whenever I display help.

Form form = new Form();
form.CreateControl();

Help.ShowHelp(form,...);

Hope this helps.
 
G

Guest

Hi Rodger,

Thx for that, it works like a charm!

Follow up question: If I open the help using F1, the window is still modal.
I also need to open the help in a pre-determined location (for example,
docked in the rightt side of the desktop). Any suggestions?

Thx in advance!
 
R

Rodger Constandse

You probably have a handler for F1 key or HelpRequested event somewhere in your
app that is still calling the Help.ShowHelp in the old way. I route all my "help
display" calls through a single function that uses the saved "Help Host" form.

Check for HelpRequested event handlers, which are raised when you press F1. Or
maybe you are using a HelpProvider component?

As far as the location, maybe try setting the size/location of the "help host"
form after calling ShowHelp. I haven't tried this myself so I'm not sure if it
will work.

Good luck.
 
G

Guest

Hi Rodger,

I was indeed using HelpProvider, and I also added event handlers to trap the
HelpRequested event and launch the custom ShowHelp form with the dummy Help
Host form. All that works great.

The only thing I couldn't do is resize and position the help window, as
changing the size and location of the host form didn't seem to help. But I
guess that's the way the help works.

Thx a lot for your help!
Ameya
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top