Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use ESC to Release Active Object
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00514192
Message ID:
00514205
Views:
13
>In my app I would like my users to be able to hit the ESC key to Release the Active object no matter what it is, a form, print preview, etc, and have the previously Active object become Active.
>
>I know there must be a standard routine to do this. How do I determine what is the currently Active object and should I run the Destroy or Release method to Deactivate the object?
>
>Thank you in advance.

On your forms, you need a command button with the Cancel property set to true. I have one as a base class with the cancel prop set to true and ThisForm.lCanceled = .T. and ThisForm.QueryUnload() in the Click method. My form's QueryUnload() calls a This[Form].UpdateTables or This[Form].RevertTables depending on the value of ThisForm.lCanceled, before doing a This.Release()

In my base form class, I have the following in the Activate:
with This
   if .WindowState = 1
      .WindowState = 0
   endif
   .AddActivate()   && custom method I added to the form
   .Refresh()
endwith
Keep in mind this is NOT Lotus Notes, so Escape may not work the same for all objects that are not forms.
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform