Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
_Screen.ActiveForm.ActiveControl.Setfocus() and Grids
Message
De
23/02/2001 07:12:08
 
 
À
22/02/2001 20:53:52
Christian Cote
Les Logiciels Onoma Inc.
Longueuil, Québec, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00478668
Message ID:
00478750
Vues:
22
Hi Christian.

>> Is there a way to execute the code for all controls but not for a grid ? <<

Presumably you are doing this so that you make sure that the underlying data is updated from the control's value. You need to do a little more to accomplish this when the activeControl is a grid. You need to drill down into the grid and set focus to the active cell in the grid like so:
IF TYPE( 'Thisform.ActiveControl.Name' ) = 'C'
  loActiveControl = Thisform.ActiveControl
  IF UPPER( loActiveControl.BaseClass ) # 'GRID'
    loActiveControl.SetFocus()
  ELSE
    FOR EACH loColumn IN loActiveControl.Columns
      IF loActiveControl.ActiveColumn = loColumn.ColumnOrder
	 loControl = EVAL( 'loColumn.'+ loColumn.CurrentControl )
	 loControl.SetFocus()
	 EXIT
      ENDIF
    ENDFOR
  ENDIF			
ENDIF
Marcia
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform