Desktop HTMLViewer LoadPage w/local and anchor

  1. 7 months ago

    Arthur G

    26 Jan 2019 Pre-Release Testers, Xojo Pro

    Is there a way use HTMLViewer.LoadPage with a local page (for a help file) and have it go to an anchor?

    My code has not changed that much since this link
    http://forums.realsoftware.com/viewtopic.php?f=10&t=43410&

    @Arthur G — Yes you can do that but not with LoadPage. You will need to use LoadURL instead, so you can specify the anchor

    //In HTMLViewer.Open
    dim path as string = "/Applications/Xojo 2018 Release 3/Extras/PluginsSDK/Documentation/Plugin SDK Array Reference.html"
    dim url as string = "file:///" + EncodeURLComponent( path ) + "#REALInsertArrayValue_Type_"
    
    me.LoadURL  url
  2. Stéphane M

    27 Jan 2019 Answer France

    @Arthur G — Yes you can do that but not with LoadPage. You will need to use LoadURL instead, so you can specify the anchor

    //In HTMLViewer.Open
    dim path as string = "/Applications/Xojo 2018 Release 3/Extras/PluginsSDK/Documentation/Plugin SDK Array Reference.html"
    dim url as string = "file:///" + EncodeURLComponent( path ) + "#REALInsertArrayValue_Type_"
    
    me.LoadURL  url
  3. Arthur G

    27 Jan 2019 Pre-Release Testers, Xojo Pro
    Edited 7 months ago

    Thanks. It was worth asking just for EncodeURLComponent.

    HelpWindow.HTMLVwr.LoadURL(f.URLPath + "#GrammarUpdate")

or Sign Up to reply!