Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OKL Passing Parameters
Message
 
To
25/06/2001 16:13:54
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00523099
Message ID:
00523255
Views:
10
>>
>>OKL F1 DO ShowHelp
>>
>>ShowHelp:
>>
>>IF VARTYPE(_SCREEN.ACTIVEFORM.ACTIVECONTROL) = "O"
>>  DO HelpForm WITH _SCREEN.ACTIVEFORM.ACTIVECONTROL
>>ENDIF
>>
>>
>>I guess this is probably easier... I just like to try to stick with OO :)
>
>Brien,
>
>Sorry, I took away your stars (for the moment); I didn't want anyone to be confused about which way they should go for this issue. I found a couple previous threads about using OKL vs OOP and I like your earlier suggestion better. Trap it in the KeyPress and pass the ActiveControl. I decided to set the main form's KeyPreview to True and use the KeyPress in the form. The problem I'm having is that the ActiveControl is never an object. It always generates an error. Does it make a difference that the object that is (in my mind) current is on a Page on a PageFrame? ActiveForm is fine and when I look at in the Debugger, the ActiveControl has the, "Expression could not be evaluated." listed. Any ideas?

ACTIVECONTROL can be difficult to work with. If you have the debugger configured to display in a separate form, it will always evaluate AVTIVEFORM and ACTIVECONTROL as "Expression could not be evaluated" since the VFP form no longer has focus. If you try to step through your code in the debugger, it will fail.

I did a test of a simple form with just a pageframe and a textbox on the first page. I put the code in the form's KeyPress event (KeyPreview on) and it worked fine.
Brien R. Givens

Brampwood Systems
Previous
Reply
Map
View

Click here to load this message in the networking platform