Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
KeyPreview--no control.KeyPress
Message
From
10/04/2006 15:33:51
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
KeyPreview--no control.KeyPress
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01112147
Message ID:
01112147
Views:
64
I'm working on a form that has KeyPreview set to .T. and code in the form-level KeyPress. I'm finding that in some circumstances, the control's KeyPress doesn't fire after the form's KeyPress. In particular, it happens when I press Tab in a textbox on this form. The result in this case is that the next control in tab order is receiving the tab key, and focus is jumping two controls.

Both the form and textbox are based on subclasses and I can't duplicate this with base classes, so I know it's something I'm doing.

The code in the form class's KeyPress looks like this:
IF This.TestSomething(nKeyCode)
   This.DoSomething()
ENDIF

DODEFAULT(nKeyCode, nShiftAltCtrl)
In my testing, This.TestSomething() is returning .F., as it should, so This.DoSomething() is never called.

To see what's happening, I've used event tracking as well as DEBUGOUT in the form and control KeyPress events.

Any ideas what could suppress the control KeyPress at this level?

Tamar
Next
Reply
Map
View

Click here to load this message in the networking platform