Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bypassing events on other objects.
Message
 
 
To
18/10/2001 10:23:51
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00570234
Message ID:
00570261
Views:
18
>I am looking for a way to keep the Valid event on a TextBox from firing if I click on a navigation button (cmdCancel). There is code behind the Valid Event of the Textbox that requires data entry. However, if the user clicks cmdCancel I want the form to stop everything do all TableReverts without caring about whether or not there is text in the current TextBox that has the focus. I could not find anything written that describes how to keep some event from firing.

Eric,
Set the Cancel property of the CmdCancel button to .T.. In the Valid event of the textbox, check to see if ESC was pressed. Ex.
if lastkey() = 27 then
   return .T.
endif

* do validation processing here
The Cancel property causes the button to act as if the user hit the Escape key.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform