Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
_Screen.ActiveForm.ActiveControl.Setfocus() and Grids
Message
From
23/02/2001 07:12:08
 
 
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:
00478750
Views:
23
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
Previous
Reply
Map
View

Click here to load this message in the networking platform