vb.net - Ctrl + Shift + H cannot be detected using Me.KeyDown -
the code, not react during ctrl + shift + h pressed :
private sub hidemode(byval sendeer system.object, byval e keyeventargs) handles me.keydown select case cint(e.keycode) case keys.controlkey if e.shift andalso e.keyvalue = convert.toint32(convert.tochar(keys.h)) msgbox("test hide function") end if end select end sub
the expected result that, after pressing ctrl + shift + h msgbox
show text "test hide function"
what's error in here?
i don't underdstand why try convert keycode integer when same work done using keys enum
select case e.keycode case keys.h if (e.control andalso e.shift) msgbox("test hide function") end if end select
edit well, webbrowser control different beast. need add specific keydown handler (in addition other 1 handles keydown when focus on other controls)
private sub browser_previewkeydown(byval sender system.object, byval e system.windows.forms.previewkeydowneventargs) handles webbrowser1.previewkeydown select case e.keycode case keys.h if e.shift andalso e.control msgbox("test hide function") end if end select end sub
Comments
Post a Comment