2 Replies - 328 Views - Last Post: 12 July 2014 - 03:46 AM Rate Topic: -----

#1 sgell  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 16-August 12

F1 for Help

Posted 11 July 2014 - 03:03 PM

My VB.Net app and itís .chm help file are located on a server.
Originally the chm file only displayed contents and not the topics.
About 6 months ago the registry was edited to allow this file and it worked OK.
Now it has stopped working which I assume must be the result of a windows update.
I have solved this problem by deploying the chm file with the project.
The chm file now displays the contents and the topics but only when called with:
Dim path = System.IO.Path.Combine(Application.StartupPath, "Help.chm")
Help.ShowHelp(ParentForm, path, HelpNavigator.TableOfContents)

To a form I have added:
Help.HelpNamespace = Application.StartupPath + "Help.chm"
Me.Help.SetHelpKeyword(Me, Application.StartupPath + "sizes.htm")
Sizes.htm being the topic to be displayed on F1.

When F1 is pressed nothing happens, if it is pressed a second time the hourglass appears for a second and then disappears Ė no help topic is displayed.

I guess Iím missing something but what?

Is This A Good Question/Topic? 0
  • +

Replies To: F1 for Help

#2 andrewsw  Icon User is offline

  • It's just been revoked!
  • member icon

Reputation: 3609
  • View blog
  • Posts: 12,417
  • Joined: 12-December 12

Re: F1 for Help

Posted 11 July 2014 - 04:40 PM

The StartupPath doesn't include a backslash:
Help.HelpNamespace = Application.StartupPath & "\" & "Help.chm"

Path.Combine inserts the (appropriate) path separator for you, and it is preferable to use it rather than concatenating.

You then don't need to include the StartupPath for SetHelpKeyword, because you have already provided this in the namespace:
Me.Help.SetHelpKeyword(Me, "sizes.htm")

I am basing this information on what I read in the docs.

This post has been edited by andrewsw: 11 July 2014 - 04:44 PM

Was This Post Helpful? 0
  • +
  • -

#3 sgell  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 16-August 12

Re: F1 for Help

Posted 12 July 2014 - 03:46 AM

Can't believe I missed that, many thanks
Stephen
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1