Results 1 to 3 of 3

Thread: What's this Help?

  1. #1

    Thread Starter
    Hyperactive Member Dorothy's Avatar
    Join Date
    Feb 2001
    Posts
    310

    Question What's this Help?

    How do I use the "Whats this Help" property of a Form?
    Explain me with a clear example?

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    some programs (I think MS word does) have in the top right, a question mark button, next to the minimize, resize and close buttons of the program.
    When you press this, then click the mouse over an object, a tooltip help file appears to tell you what the objects used for.

    That's what it is. The following's from MS that should help get you started :
    Code:
    Step-by-Step Example :
    1) Create a new project in Visual Basic. Form1 is created by default. 
    2) Set the WhatsThisHelp and WhatsThisButton properties for 
       Form1 to True. 
    3)Add the following code to reference the Hotspot Editor 
      help file to the Form_Load procedure:
    
          Private Sub Form_Load()
          '  your machine
          '  Change this path to where ever Msdev.hlp is located on
             App.HelpFile = "C:\Program
             Files\DevStudio\Common\MSDev98\Help\Msdev.hlp"
     
    4) Add two menu items to Form1 using the following as a guide:
    
          Menu                   Property            Value
          ----------------------------------------------------
          WhatsThis              Caption            WhatsThis
          WhatsThis              Name               mnuWhatsThis
          WhatsThis              Visible            False
    
          What's This?           Caption            What's This?
          What's This?           Name               mnuWhatsThisHelp
     
    5) Indent "What's This?" to make it a sub-menu of WhatsThis 
       by pressing the right-arrow button on the Menu Editor. 
    6) Add the following code to the General Declarations section of Form1:
    
       Public ThisControl as control
    
    7) Add the following code to the mnuWhatsThisHelp_Click procedure:
    
       Private Sub mnuWhatsThisHelp_Click()
          ThisControl.ShowWhatsThis
       End Sub
     
    8) Add a Command Button control to the form and set the following Properties: 
    
       WhatsThisHelpID = 1
       HelpContextID = 5 
    
    9) Add following code to the Command1_MouseUp event:
    
       Private Sub Command1_MouseUp(Button As Integer, _
       Shift As Integer, X As Single, Y As Single)
           If Button = vbRightButton Then
               Set ThisControl = Command1
               PopupMenu mnuWhatsThis
           End If
           Set ThisControl = Nothing
       End Sub
     
    10)Run the application. Right-click on the Command button and then 
    left- click on the "What's This?" popup to bring up the Help file.
    Last edited by alex_read; May 9th, 2001 at 10:49 AM.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  3. #3

    Thread Starter
    Hyperactive Member Dorothy's Avatar
    Join Date
    Feb 2001
    Posts
    310

    Thanks a lot Alex

    Thanks a lot Alex

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