|
-
Nov 15th, 2005, 03:47 AM
#1
[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
-
Nov 15th, 2005, 03:58 AM
#2
Re: using WhatThisButton
VB Code:
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
VB.NET MVP 2008 - Present
-
Nov 15th, 2005, 04:26 AM
#3
Re: using WhatThisButton
thnx HanneS,
but there is no MsDev.hlp file on my system. i checked it.
-
Nov 15th, 2005, 05:47 AM
#4
Re: using WhatThisButton
 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
-
Nov 16th, 2005, 08:04 AM
#5
Re: using WhatThisButton
 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?
-
Nov 16th, 2005, 08:16 AM
#6
Hyperactive Member
-
Nov 16th, 2005, 08:17 AM
#7
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.
-
Nov 16th, 2005, 08:31 AM
#8
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?
-
Nov 16th, 2005, 08:42 AM
#9
Re: using WhatThisButton
Yes you can use a CHM file.
-
Nov 16th, 2005, 08:42 AM
#10
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
-
Nov 16th, 2005, 09:22 AM
#11
Re: using WhatThisButton
all right. thank all of you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|