Results 1 to 10 of 10

Thread: Help files in a win app

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2003
    Location
    South Africa
    Posts
    13

    Help files in a win app

    Hi

    How do I insert a help button on my form. I have added a HelpProvidor component and also have set Form.ShowHelp on HelpProvidor1 to true but what does that do?

    Then once I get that working to an .htm file, if I want to compile it to a .chm file then where on earth do I find the HTML Help Workshop that's supposed to be part of .NET (or so it says in the help)?!

    Thanks in advance to anyone who helps!

    Liz

  2. #2
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536
    Get HTML Help Workshop from here


    There is a HelpButton property on the form that should display a help button on the caption bar - is this what you meant? This will only be displayed if the Maximise and Minimise properties are set to False - not quite sure why...

    I think the ShowHelp property is applied to the controls that you want help shown for. I guess that also applies to the form - you could show help for the form as a whole.

    Does this help?
    This world is not my home. I'm just passing through.

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2003
    Location
    South Africa
    Posts
    13
    You are right - I meant HelpButton. But it doesn't show with MaximiseBox and MinimiseBox set to false. There is no Maximise and Minimise. I can't get the button to show.

    Thanks for Workshop link

  4. #4
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536
    That's strange.

    I've just started a new project and set the HelpButton property on Form1 to True and the MinimizeBox and MaximizeBox properties to False. The form gets the Help Button on the caption bar ok.

    What are you doing different?

    PS. You're in South Africa? Anywhere near my in-laws in Fish Hoek?
    This world is not my home. I'm just passing through.

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2003
    Location
    South Africa
    Posts
    13
    Ok, it works but now I don't want to disable maximising and minimising. *sigh*

    I really don't want to hard code the toggle button 'What's This?' kind of help though. Any other way to do it?

    Liz

    PS No, I'm In Johannesburg. Fish Hoek is a nice place to live I hear

  6. #6

    Thread Starter
    New Member
    Join Date
    Aug 2003
    Location
    South Africa
    Posts
    13
    Do you know how to call the help provider dynamically in the code(Without using the event F1 keypressed). passing the keyword to it????????????

    Want a What's this type of context menu style.
    -Got all the context menu and the event sorted out just can't call the help in the event.

    thanks

  7. #7
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536
    I've had a think about your other questions but I haven't been able to come up with a solution. I played around with ErrorProviders and ToolTips for a while, but I don't think they'll do what you want. I also thought about RaiseEvent, but that also looks like a non-starter.

    If you want to explain in a bit more detail what you want to achieve with your application I could maybe suggest some different ways of doing it...
    This world is not my home. I'm just passing through.

  8. #8

    Thread Starter
    New Member
    Join Date
    Aug 2003
    Location
    South Africa
    Posts
    13
    Ok, all we want is to call the help file and pass a keyword to it from anywhere in the app. Mostly this will be from a context menu.

    I can't understand why there is no provision for this in .NET?

    We could maybe compile an exe out of the help file but how to do this? It doesn't help with the keyword though.

    We can get the F1 part to work.

    *sigh*

    Thanks for RaiseEvent answer. I think we can maybe do something with that.

  9. #9
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536
    Maybe this extract from MSDN is what you're looking for (then again, maybe I haven't properly understood what you're doing...)


    EDIT: Sorry - the quote looks a bit difficult to read. I'm suggesting that you use the ShowHelp( ParentControl, HelpFile, KeyWord ) method. Search for "Help.ShowHelp" in Help to get more info.


    Displays the contents of the Help file found at the specified URL for a specific keyword.

    [Visual Basic]
    Overloads Public Shared Sub ShowHelp( _
    ByVal parent As Control, _
    ByVal url As String, _
    ByVal keyword As String _
    )

    [C#]
    public static void ShowHelp(
    Control parent,
    string url,
    string keyword
    );

    [C++]
    public: static void ShowHelp(
    Control* parent,
    String* url,
    String* keyword
    );

    [JScript]
    public static function ShowHelp(
    parent : Control,
    url : String,
    keyword : String
    );

    Parameters
    parent
    A Control that identifies the parent of the Help dialog box.
    url
    The path and name of the Help file.
    keyword
    The keyword to display Help for.
    Remarks
    The url parameter can be of the form C:\path\sample.chm or/folder/file.htm.

    If you provide the keyword a null reference (Nothing in Visual Basic), the table of contents for the Help file will be displayed.

    Example
    [Visual Basic, C#, C++] The following example displays a form with three buttons that can be used to interact with the mspaint.chm Help file. The Show Help Index button displays the Index tab for the Help file. The Show Help button displays content in the Help file based on the value selected in the Help Navigator list. The Show Keyword button displays content in the Help file based on the keyword specified in the Keyword text box.

    [Visual Basic, C#, C++] For example, to show the Ovals Help page by the index value, select the HelpNavigator.KeywordIndex value in the Help Navigator drop-down list, type "ovals" (without the quotation marks) in the Parameter text box, and click the Show Help button. To show the "To paint with a brush" Help topic by the keyword, type "mspaint.chm::/paint_brush.htm" (without the quotation marks) in the Keyword text box and click the Show Keyword button.

    [Visual Basic, C#, C++] This example only shows the call to ShowHelp. See the Help class overview for the complete code example.

    [Visual Basic]
    Private Sub showKeyword_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles showKeyword.Click
    ' Display Help using the provided keyword.
    Help.ShowHelp(Me, helpfile, keyword.Text)
    End Sub 'showKeyword_Click
    This world is not my home. I'm just passing through.

  10. #10

    Thread Starter
    New Member
    Join Date
    Aug 2003
    Location
    South Africa
    Posts
    13
    Thanks!

    That's great. Think it might just work. hehe

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width