Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Default Button
Message
From
10/12/2000 17:14:58
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Default Button
Miscellaneous
Thread ID:
00451407
Message ID:
00451407
Views:
71
Hey Larry

How goes? Congrats on getting MVP. Here's a little VMP style problem and solution I've come up with. I've got my frmDEGridNav2Pages form with a Selection Criteria container on the first page. There's a button to trigger generating the view parameters and requerying the view.

I wanted to make the enter key click the button, so I initially set the button's DEFAULT property to .T. in the ctrSelCriteria.GotFocus and reset it to .F. in the ctrSelCriteria.LostFocus.

I gave up on that when I found that even though the LostFocus was firing and setting the Default to .F., the button remained the default even when I went to the next page. I even tried putting code in the pgfPageRefresh.CommonPageActivate to set the default to .F..

Anyways, what I finally did was to set THISFORM.KeyPreview to .T. and added some code in the form's KeyPress to check for an enter key and if the object obtained by oForms.RealActiveControl() was in my ctrSelCriteria. If that condition was met, I fired the method called by the button's click.

Strange but true.
Next
Reply
Map
View

Click here to load this message in the networking platform