"What's This" type button

BrettM

just a pert, "ex" to come
Local time
Tomorrow, 00:05
Joined
Apr 30, 2008
Messages
134
I nearly have all my ducks in a row with a project I have been working on. Now down to the final dash and have completed all the necessary help files. All I need now is a way to simulate the "what's this" button on a form.

My problem is that I am using a form with no border so the standard "what's this" button cannot show.

Can anyone offer a solution to create a similar standard type button on the forms body please?

Regards Brett
 
After much searching I came up with a variant of a VB NET proceedure. Trouble is, it doesn't work as expected.

I have a new module with the following code in it...

Code:
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" _
(ByVal hWnd As Integer, _
ByVal wMsg As Integer, _
ByVal wParam As Integer, _
ByVal lParam As Integer) _
As Integer
 
Private Declare Function GetActiveWindow Lib "user32" () As Integer
 
Private Const WM_SYSCOMMAND = &H112
Private Const SC_CONTEXTHELP = &HF180
 
Public Sub WhatsThisMode()
    If Not PostMessage(GetActiveWindow(), WM_SYSCOMMAND, SC_CONTEXTHELP, 0) Then
        MsgBox "This is not good!"
    End If
End Sub
It is attached to a button on a form. Apparently it should make the cursor behave the same way as clicking the "What's This" button. It is close but not quite right. Can anyone expand on it please?

Regards Brett
 
How to create a "What's This" shortcut menu.

1.
click on you menu bar and select Customise

2.
Select New Menu and create your What's This option

3. Switch to Tools bars and select Toolbar properties

4.
Change the type to popup which will create a shortcut menu for you

5.
Go to the properties to the contriol on your form and assign the shortcut menu to the control

That's if my memory serves me correctly.

David
 
Thanks David,

I have this running already for all my controls however the user must be in the control to use it. Pressing F1 gives the same result. The problem is thought that it only works for active controls. The "What's This" button works on anything.

Once I get it right, it will be on my main user menu as part of the Help Options. Trouble is... getting it right in the first place.

Are you familiar with the User32 Libray David? Am I on the right track here?

Regards Brett.
 

Users who are viewing this thread

Back
Top Bottom