Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Works with click not with keypress
Message
De
25/01/2005 07:23:46
 
 
À
25/01/2005 07:15:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 5
Database:
Visual FoxPro
Divers
Thread ID:
00980321
Message ID:
00980331
Vues:
30
Has the focus means that the cursor is on that object (e.g. it's highlighted). So to test for the KeyPress() even of an object, that object (in this case the text box in the grid) needs to be selected.

Do you want this code to fire 1) when you click on a grid row, and 2) when you use the keyboard to scroll up and down through the grid (i.e. as you go to each row in the grid)? If so you could put the same code in the AfterRowColChange() event of the grid.

>hi,
>thank you,i try to put under (lostfocus event ).nothing happend
>
>what you mean with (i.e. your grid's text box needs to have the focus).
>thanks.
>
>
>>I expect it's because the Click() event is not the same as a KeyPress() event! And if you use a keypress() event you need to be sure that the object it belongs to has the focus, i.e. your grid's text box needs to have the focus.
>>
>>>hi all,
>>>
>>>why thiscode under works with click event at mygrid.column2.text1,
>>>
>>>but did not work with keypress also if i run mycode via vfp7.
>>>
>>>  m.a=thisform.timeadd(thisform.timeadd(thisform.timeadd(thisform.timeadd(true,hot),balanc),mint),other)
>>>   m.w=thisform.timeadd(plan,("00:00:00"))
>>>IF m.a=m.w and m.a>"00:00:00" and m.w>"00:00:00"
>>>          *=MessageBox("true")
>>>          grdTable = thisform.Grid1.RecordSource
>>>          thisform.Grid1.column7.SetFocus()
>>>          SKIP IN (grdTable)
>>>    IF EOF()
>>>       SKIP -1 IN (grdTable)
>>>    ENDIF
>>>
>>>ELSE
>>>      =MessageBox("false")
>>>      thisform.Grid1.column7.SetFocus()
>>>ENDIF
>>>
>>>
>>>THANKS.
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform