Click here to Skip to main content
16,012,759 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All

I have created a help file (.chm) for my system. When I call it in my application and click on the help icon, the help file loads but when i press F1 on the keyboard-the help file doesnt load.I designed my main form using ribbon.

Here is my code for F1:
C#
private void MainForm_KeyUp(object sender, KeyEventArgs e)
        {

 if (e.KeyCode == Keys.F1)
            {
                try
                {
                    string filePath = "NMMU Residence System Help.chm";
                    System.Windows.Forms.Help.ShowHelp(null, filePath);

                }

                catch
                {
                    MessageBox.Show("Error displaying help", " ", MessageBoxButtons.OK, MessageBoxIcon.Error);

                }
            }
}

-this code doesnt give me errors when i run it.. What could i be doing wrong?

Also,how do i go about linking a specific topic to a selected form?

Thanks
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900