Results 1 to 11 of 11

Thread: [RESOLVED] using WhatThisButton

  1. #1

    Thread Starter
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Resolved [RESOLVED] using WhatThisButton

    hi all,

    how can i use the WhatThisbutton property of the form? i changed the from to fixed dialog and set this property to TRUE, but how can i show the yellow box when i use this button during runtime?

    thnx
    Show Appreciation. Rate Posts.

  2. #2
    Frenzied Member HanneSThEGreaT's Avatar
    Join Date
    Nov 2003
    Location
    Vereeniging, South Africa
    Posts
    1,492

    Re: using WhatThisButton

    VB Code:
    1. 1) Create a new project in Visual Basic. Form1 is created by default.
    2. 2) Set the WhatsThisHelp and WhatsThisButton properties for
    3.    Form1 to True.
    4. 3)Add the following code to reference the Hotspot Editor
    5.   help file to the Form_Load procedure:
    6.  
    7.       Private Sub Form_Load()
    8.       '  your machine
    9.       '  Change this path to where ever Msdev.hlp is located on
    10.          App.HelpFile = "C:\Program
    11.          Files\DevStudio\Common\MSDev98\Help\Msdev.hlp"
    12.  
    13. 4) Add two menu items to Form1 using the following as a guide:
    14.  
    15.       Menu                   Property            Value
    16.       ----------------------------------------------------
    17.       WhatsThis              Caption            WhatsThis
    18.       WhatsThis              Name               mnuWhatsThis
    19.       WhatsThis              Visible            False
    20.  
    21.       What's This?           Caption            What's This?
    22.       What's This?           Name               mnuWhatsThisHelp
    23.  
    24. 5) Indent "What's This?" to make it a sub-menu of WhatsThis
    25.    by pressing the right-arrow button on the Menu Editor.
    26. 6) Add the following code to the General Declarations section of Form1:
    27.  
    28.    Public ThisControl as control
    29. 7) Add the following code to the mnuWhatsThisHelp_Click procedure:
    30.  
    31.    Private Sub mnuWhatsThisHelp_Click()
    32.       ThisControl.ShowWhatsThis
    33.    End Sub
    34.  
    35. 8) Add a Command Button control to the form and set the following Properties:
    36.  
    37.    WhatsThisHelpID = 1
    38.    HelpContextID = 5
    39.  
    40. 9) Add following code to the Command1_MouseUp event:
    41.  
    42.    Private Sub Command1_MouseUp(Button As Integer, _
    43.    Shift As Integer, X As Single, Y As Single)
    44.        If Button = vbRightButton Then
    45.            Set ThisControl = Command1
    46.            PopupMenu mnuWhatsThis
    47.        End If
    48.        Set ThisControl = Nothing
    49.    End Sub
    50.  10)Run the application. Right-click on the Command button and then
    51. left- click on the "What's This?" popup to bring up the Help file
    VB.NET MVP 2008 - Present

  3. #3

    Thread Starter
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: using WhatThisButton

    thnx HanneS,

    but there is no MsDev.hlp file on my system. i checked it.
    Show Appreciation. Rate Posts.

  4. #4
    Frenzied Member HanneSThEGreaT's Avatar
    Join Date
    Nov 2003
    Location
    Vereeniging, South Africa
    Posts
    1,492

    Re: using WhatThisButton

    Quote Originally Posted by Harsh Gupta
    thnx HanneS,

    but there is no MsDev.hlp file on my system. i checked it.
    Hi, the MsDev.hlp was just an example file - you must use your own helpfile there.
    VB.NET MVP 2008 - Present

  5. #5

    Thread Starter
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: using WhatThisButton

    Quote Originally Posted by HanneSThEGreaT
    Hi, the MsDev.hlp was just an example file - you must use your own helpfile there.
    thank you very much HanneS. could you please explain the values of

    WhatsThisHelpID = 1
    HelpContextID = 5.

    i mean how to determine these values?
    Show Appreciation. Rate Posts.

  6. #6

  7. #7
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: using WhatThisButton

    The help ID's and context ID's are something you set to each topic when you design the help file. The box that comes up is a page from the help file.

  8. #8

    Thread Starter
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: using WhatThisButton

    thnx Joacim and GrimmReaper.

    just one more question. can .chm file can be used instead of .hlp?

    if no then how can i make .hlp file?
    Show Appreciation. Rate Posts.

  9. #9
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: using WhatThisButton

    Yes you can use a CHM file.

  10. #10
    Frenzied Member HanneSThEGreaT's Avatar
    Join Date
    Nov 2003
    Location
    Vereeniging, South Africa
    Posts
    1,492

    Re: using WhatThisButton

    Well, the easiest way would be to use the HTML Help Editor

    You could also look at the Help Compiler Workshop, there should be a tool called HCW in your VB 98 directory (somewhere) or on the VB6 cd
    VB.NET MVP 2008 - Present

  11. #11

    Thread Starter
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: using WhatThisButton

    all right. thank all of you.
    Show Appreciation. Rate Posts.

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