Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with keypres and focus
Message
 
 
To
19/09/2003 16:24:10
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00830770
Message ID:
00830796
Views:
20
Try
  CASE nKeyCode = 19 AND nShiftAltCtrl = 2  && Ctrl+S
    ThisForm.CmdSave.setfocus()
    ***ThisForm.CmdSave.click()
    KEYBOARD "{ENTER}"
Notice that you don't need LASTKEY() function because key code is passed into form's FeyPress event as nKeyCode parameter.


>Hi everyones,
>
>In the Keypress event of a form (form's base class actually) I have this piece of code:
>
>DO CASE
>  CASE LASTKEY() = 19 AND nShiftAltCtrl = 2  && Ctrl+S
>    ThisForm.CmdSave.setfocus()
>    ThisForm.CmdSave.click()
>
>
>In CmdSave.click() I do some processing and I do TxtBoxA.setfocus()
>
>When I click with the mouse, to focus goes to TxtBoxA.
>When I use Ctrl+S the process fire, TxtBoxA get the focus and then it loose it, the focus goes back to the form's grid
>
>When I try to debug, using "set step on", I see the focus goes to TxtBoxA, nothing else is done, and the focus stay there. As soon as I remove the"set step on" command, the focus doesn't stay where it should.
>
>Any ideas?
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform