Hotkey vs .Net Application
Hi,
This gave me big surprise when i saw a post that the Hotkey are not displaying untill u press “ALT“ button on .Net application.But any how i found solution for this. Atually , this is behaviour of OS(XP and 2000) nothing wrong with .Net application.
1. Go to Desktop and right click on properties.
2. Click on Apearance Tab ,Click “Effect“ Button
3. It will looks like given below picture.
4. Uncheck the “Hide Underlined letters for keyboard navigation untill i press ALT Key “
This will solve ur problem.
On other way we can do it programatically ..here is the code for it for more find the link
http://www.partware.com/ebooks/api/ref/d/destroywindow.html
Thanks to Herfried for this code
\\\
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
///
Happy coding cheers....
Suresh