vb.net - Detect Print Screen keyup and keydown in Keyboard Tester app VB NET -



vb.net - Detect Print Screen keyup and keydown in Keyboard Tester app VB NET -

i have problem when seek create keyboard tester application little office. cant observe print screen keycode e.keycode = keys.printscreen.

i alter picturebox color when key down, seems doesnt work print screen, nil happen.

my code is:

private sub keyboardmenu_keydown(sender object, e keyeventargs) handles me.keydown 'esc + function keys ----------------------------------------- if e.keycode = keys.escape escbox.backcolor = color.red end if if e.keycode = keys.f1 f1box.backcolor = color.red end if if e.keycode = keys.f2 f2box.backcolor = color.red end if if e.keycode = keys.f3 f3box.backcolor = color.red end if if e.keycode = keys.f4 f4box.backcolor = color.red end if if e.keycode = keys.f5 f5box.backcolor = color.red end if if e.keycode = keys.f6 f6box.backcolor = color.red end if if e.keycode = keys.f7 f7box.backcolor = color.red end if if e.keycode = keys.f8 f8box.backcolor = color.red end if if e.keycode = keys.f9 f9box.backcolor = color.red end if if e.keycode = keys.f10 f10box.backcolor = color.red end if if e.keycode = keys.f11 f11box.backcolor = color.red end if if e.keycode = keys.f12 f12box.backcolor = color.red end if 'end of esc + function keys ----------------------------------------- private sub keyboardmenu_keyup(sender object, e keyeventargs) handles me.keyup 'esc + function keys ---------------------------------------- if e.keycode = keys.f1 f1box.backcolor = color.transparent end if if e.keycode = keys.f2 f2box.backcolor = color.transparent end if if e.keycode = keys.f3 f3box.backcolor = color.transparent end if if e.keycode = keys.f4 f4box.backcolor = color.transparent end if if e.keycode = keys.f5 f5box.backcolor = color.transparent end if if e.keycode = keys.f6 f6box.backcolor = color.transparent end if if e.keycode = keys.f7 f7box.backcolor = color.transparent end if if e.keycode = keys.f8 f8box.backcolor = color.transparent end if if e.keycode = keys.f9 f9box.backcolor = color.transparent end if if e.keycode = keys.f10 f10box.backcolor = color.transparent end if if e.keycode = keys.f11 f11box.backcolor = color.transparent end if if e.keycode = keys.f12 f12box.backcolor = color.transparent end if 'end of esc + function keys ----------------------------------------- end sub

please help me. idk if there more keys print screen problem.

thank you

i'm not sure of real reason, i've read before , came conclusion windows protecting key's event beingness handled. else knows better, works:

protected overrides function processkeyeventargs(byref msg message) boolean if msg.wparam = keys.printscreen messagebox.show("printscreen key press detected!") end if homecoming mybase.processkeyeventargs(msg) end function

also, should set of if statements in select case statement:

private sub keyboardmenu_keydown(byval sender object, byval e keyeventargs) handles me.keydown select case e.keycode case keys.escape escbox.backcolor = color.red case keys.f1 f1box.backcolor = color.red case keys.f2 f2box.backcolor = color.red 'etc end select end sub

vb.net

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -