Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

about short cut in vb

14 views
Skip to first unread message

k-re

unread,
Apr 21, 2003, 9:19:40 AM4/21/03
to
hi, i am developing an application and i have a submit button (command). I
would like to create a short cut key (hot key) for that button and i did it
by saying on property button "&Command" but when i run it i can't see the
short cut key......it just displays Command without the underline in it...

Would you please help?

Thanks,
KB


Chris Dunaway

unread,
Apr 21, 2003, 9:55:37 AM4/21/03
to
"k-re" <chy...@hotmail.com> wrote in
news:uGsxniAC...@TK2MSFTNGP10.phx.gbl:

Does it display when you hold the ALT key down? If so, then this is a
setting in Windows 2K and XP. If you right click on the desktop and choose
properties. On the Effects tab, there should be an option which will
change this.

Chris

--
If you don't like lunchmeat, please remove it from my e-mail address to
send me an e-mail

Herfried K. Wagner

unread,
Apr 21, 2003, 10:24:17 AM4/21/03
to
Hello,

"k-re" <chy...@hotmail.com> schrieb:


> hi, i am developing an application and i have a submit
> button (command). I would like to create a short cut key
> (hot key) for that button and i did it by saying on property
> button "&Command" but when i run it i can't see the
> short cut key......it just displays Command without the underline in
it...

This is by design in Windows 2000/XP, the user can change this through
the display control panel.

"Is there a setting for this or a fix?"

\\\
Private Declare Function SendMessage Lib "user32.dll" _
Alias "SendMessageA" ( _
ByVal hWnd As IntPtr, _
ByVal wMsg As Int32, _
ByVal wParam As Int32, _
ByVal lParam As Int32 _
) As Int32

Public Const WM_CHANGEUISTATE As Int32 = &H127

Public Const WM_QUERYUISTATE As Int32 = &H129
Public Const WM_UPDATEUISTATE As Int32 = &H128

Public Const UIS_SET As Int32 = 1
Public Const UIS_CLEAR As Int32 = 2
Public Const UIS_INITIALIZE As Int32 = 3

Public Const UISF_HIDEFOCUS As Int16 = &H1
Public Const UISF_HIDEACCEL As Int16 = &H2
Public Const UISF_ACTIVE As Int16 = &H4 ' Erfordert Windows XP.

Public Sub MakeAcceleratorsVisible(ByVal c As Control)
SendMessage( _
c.Handle, _
WM_CHANGEUISTATE, _
MAKELONG(UIS_CLEAR, UISF_HIDEACCEL), _
0 _
)
End Sub

Public Function LOWORD(ByVal dw As Int32) As Int16
If dw And &H8000 Then
LOWORD = &H8000 Or (dw And &H7FFF)
Else
LOWORD = dw And &HFFFF
End If
End Function

Public Function HIWORD(ByVal dw As Int32) As Int16
If dw And &H80000000 Then
HIWORD = (dw \ 65535) - 1
Else
HIWORD = dw \ 65535
End If
End Function

Public Function MAKELONG( _
ByVal wLow As Int32, _
ByVal wHigh As Int32 _
) As Int32
MAKELONG = _
LOWORD(wLow) Or (&H10000 * LOWORD(wHigh))
End Function

Private Sub Button1_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs _
) Handles Button1.Click
MakeAcceleratorsVisible(Me)
End Sub
///

Regards,
Herfried K. Wagner


Vincent Wiegel

unread,
Apr 21, 2003, 9:55:58 AM4/21/03
to
If you hit the ALT key does the underline appear? If so you have the option
of Hide underline character until ATL key pressed active. This is in the
Display properties-->Appearance-->Effects

Vince

"k-re" <chy...@hotmail.com> wrote in message
news:uGsxniAC...@TK2MSFTNGP10.phx.gbl...

0 new messages