Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Lost Focus/Valid code runs in Grid
Message
From
09/08/1999 04:04:32
 
 
To
09/08/1999 01:12:16
Amit Abhangrao
Charmi Software Exports
Mumbai, India
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00251345
Message ID:
00251364
Views:
10
Hi Mallari.

>> If i press F2(-1) Key from any column, It runs Valid and Lost focus code of "Column1.Text1". I dont want to run valid code when i am setting focus to that. <<

Since you are not going to change the way in which the events fire, your best bet is to set a flag so you can decide when to execute the code. Something like this might work:

Add a property to your grid class and call it something like lSettingFocus. Then:
If Lastkey() = -1
   ThisForm.Grid1.Column1.Text1.lSettingFocus = .T.
   ThisForm.Grid1.Column1.Text1.SetFocus()
   ThisForm.Grid1.Column1.Text1.lSettingFocus = .F.
EndIf
Then, just wrap the method code with

IF !ThisForm.Grid1.Column1.Text1.lSettingFocus

(Your code here)

ENDIF

Marcia
Previous
Reply
Map
View

Click here to load this message in the networking platform