Question

I have a c# winform application that displays an help file when the help button is clicked. The problem is that whenever the help file is shown. if the try to click my main App in the task bar, the HelpFile shows instead.

This is the code that shows the HelpFile

    private void frmWelcome_HelpButtonClicked(object sender, CancelEventArgs e)
    {
        Help.ShowHelp(this, "HelpFile.chm", "Welcome.htm");
    }

Please how do i rectify this. What i want is that the App shows when it is clicked in the taskbar even if the help file is open

Was it helpful?

Solution

Your problem is because you passed your main UI form (this) into the ShowHelp() method as the Parent of your help window. Try this

private void frmWelcome_HelpButtonClicked(object sender, CancelEventArgs e)
{
    Help.ShowHelp(new Control(), "HelpFile.chm", "Welcome.htm");
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top