Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trap Ctrl+C keystrokes
Message
From
18/01/2010 12:31:25
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01444401
Message ID:
01444576
Views:
52
>It can also be this one: on key label CTRL+C exec( iif( type("_screen.activeForm")='O','_screen.activeForm.doCtrlC()', '*' ) )
>
>You can also set the value for the on key command in the Activate() and Deactivate() of the form.
>
>Activate: on key label CTRL+C thisform.doCtrlC()
>Deactivate: on key label CTRL+C
>
>Most times I use an object reference variable for a form:
>
>do form frmMain name goMainWindow
>
>AFTER THE INIT of the form that variable can be used:
>
>on key label CTRL+C m.goMainWindow.doCtrlC()
>
>That will even work when the user has switched to e.g. a subform.

The small downside to this is you need a public variable for this - and then you need to make sure you destroy that variable when the form destroys. Also, you can't run this form twice at a time (because the variable will point to the most recent one and nothing will point to the old one). The upside is that you don't need to check whether _activeform exists, and whether it has the method you want.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform