Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do we know the 'Current Object' ?
Message
De
19/07/1999 08:22:15
 
 
À
19/07/1999 07:27:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00243011
Message ID:
00243021
Vues:
47
Hi Harry.

>> The "object.activecontrol.property" syntax seems to me to be far too limited as it requires you to know exactly what 'parent' object is active before you can reference the object you are really interested in. If you're writing a global handling routine which depends on field types, current content etc, you need something like sys(18) to tell you what variable you are currently playing with, regardless of what form or page or grid or listbox or whatever it may be part of... <<
LOCAL loControl, loColumn
IF TYPE('_Screen.ActiveForm.ActiveControl') = 'O'
   IF _Screen.ActiveControl.BaseClass = 'GRID'
      * Drill Down into the grid to find the Active Cell
      loColumn = _Screen.ActiveForm.ActiveControl.Columns[_Screen.ActiveForm.ActiveControl.ActiveColumn]
      loControl = loColumn.CurrentControl
   ELSE
      loControl = _Screen.ActiveForm.ActiveControl
   ENDIF
ENDIF
This is all untested and written off the top of my head, so you will need to tweak it. But you get the general idea...

Marcia
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform