Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How is the form events order when its calling
Message
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00851707
Message ID:
00852536
Views:
9
Soykan,

>Thanks for the reply David, how is your suggest,which event for leave F2 key via ON KEY LABEL F2

If I am misunderstanding the question or you need more details let me know ok?

Assuming your form has an AddNew() method.
* Form.KeyPress( nKeycode, nShiftAltCtrl )
if ( nKeyCode = -1 ) && F2
   this.AddNew()
   nodefault && prevent the key from being seen by the current ActiveControl
endif

return dodefault( nKeycode, nShiftAltCtrl )

* Toolbar.cmdAddNew.Click()
_screen.ActiveForm.AddNew()
Of course your toolbar button should check to see if there actually is a form active (type( "_screen.ActiveForm" ) = "O" at the moment and that it supports the AddNew() interface using pemstatus(). That sort of code should be in the CommandButton subclass that you are using on toolbars.

The above code means that you don't ever have to do any ON KEY LABEL commands, each form is responsible for its own handling of the F2 keypress. And no form stomps on any other form.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform