Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
_Screen.ActiveForm.ActiveControl.Setfocus() and Grids
Message
 
 
To
22/02/2001 20:53:52
Christian Cote
Les Logiciels Onoma Inc.
Longueuil, Quebec, Canada
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00478668
Message ID:
00478673
Views:
32
>HI,
>I've put this in my click() method of my base class toolbar button :
>
>_Screen.ActiveForm.ActiveControl.Setfocus()
>
>To make sure that if a control has the focus when I issue TABLEUPDATE(), the toolbar button will act Like a command button on the form, it will save all fileds even the one of the textbox that have the focus on. But when the activecontrol is a grid, I get the error message :
>
>ACTIVECONTROL is not an object.
>
>Is there a way to execute the code for all controls but not for a grid ? I tried:
>IF _Screen.ActiveForm.ActiveControl.Baseclass <> "GRID" but I get the same error message.
>
>Thank you for your help,
>
Christian,

You may put this condition, so you wouldn't have an error:
if type('_screen.ActiveForm.ActiveControl')="O"
   _screen.ActiveForm.ActiveControl.SetFocus()
endif
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform