ms access - How to Absorb a Keypress? -
on form have edit control. have set keydown event detect when user pushes enter, want detect shift+space user can clear contents of box.
the functionality works - can detect keypress. problem space not absorbed , space glyph still typed in control.
how can absorb keypress when push shift+space?
private sub findbox_keydown(keycode integer, shift integer) select case keycode case vbkeyenter: searchforit case vbkeyspace: if shift = 1 findbox.text = "" 'here absorb keypress instead of sending space control exit sub end if end select end sub
you need set value of keycode = 0. "swallow" key , not have happen.
you want use bit mask presence of shift being pressed
dim intshiftdown integer intshiftdown = (shift , acshiftmask) > 0 case vbkeyspace: if intshiftdown findbox.text = "" 'here absorb keypress instead of sending space control keycode = 0 exit sub
Comments
Post a Comment