Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Category:
Coding, syntax & commands
>>Hi Fred,
>>
>>loActiveControl = This.GetActiveControlRef(_Screen.ActiveForm.ActiveControl)
>>This line is part of a save routine(write buffer) which is trying to to get the active control so I could check to determine if the user is currently in a grid. IF the user is currently in a grid then I would loop through the columns in the grid to find the active column then the active control with in that column. *!* Also This code is also in the VFP FFC _app.vcx base class (_datasession, dataflush method)
>>
>>Thank you for responding.
>>
>>Andy
>
>Since you're using it in an object of some sort, is the "this" you're refereing to on a form? If it is, try doing "thisform.ActiveControl". You may also want to check to make sure that it is an object before attempting to use it.
>
>IF TYPE("_SCREEN.ActiveForm.ActiveControl")="O" ...
Fred,
I have a very similar problem. My textbox is based on a class. In the WHEN method of the class I placed the following line:
ThisForm.oCurrentObject = _SCREEN.ActiveForm.ActiveControl
oCurrentObject is a property I created on the form. I have other code in a method that sets the focus to oCurrentObject like this:
IF Type('ThisForm.oCurrentObject')="O"
ThisForm.oCurrentObject.SetFocus()
ENDIF
I get the "ActiveControl is not an object" message on the class WHEN method. I have tried putting the code in the GOTFOCUS and various permutations of "ThisForm" vs "__SCREEN.Active.Form" with the same results.
Any ideas? Thanks!
Renoir
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only