Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating an auto-repeat command button
Message
From
10/01/2002 23:35:26
 
 
To
10/01/2002 23:17:17
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00603161
Message ID:
00603336
Views:
19
I'm sorry again. Right you are about point number 2. This fixes that:
LPARAMETERS nKeyCode, nShiftAltCtrl

if nKeyCode = 32
	nKeyCode = 13
	nodefault
	dodefault(nKeyCode, nShiftAltCtrl)
endif
>Hi Steve,
>
>Thanks for your feedback! I tried your suggestion and it failed for 2 reasons:
>
>1. The KeyPress event on a command button isn't fired until the user releases the space key (after the 'KeyUp' event). If command buttons had a 'KeyDown' event then your idea would probably work.
>
>2. Strange, but true - under VFP 7 (didn't try VFP 6), your code prevents the command button from losing focus via the keyboard. I can change focus by using the mouse, but the tab and arrow keys will not exit me from the command button.
>
>Any other suggestions? What I think(?!) I'm looking for is a Windows API function to check for a KeyDown event (KeyPressed vs. KeyPress?). I guess I would have to set a timer to check the status of the Space key - if pressed, do the Click event.
>
>Malcolm
>
Steve Gibson
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform