Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Freezing a Column in a Grid
Message
De
22/12/1997 20:44:43
 
 
À
22/12/1997 04:03:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00067450
Message ID:
00067635
Vues:
28
>>>I am using a grid for data entry. Every control on the grid is marked ReadOnly = .T., TabStop = .F. except for the one I want the user to utilize.
>>>
>>>I want / to move the user to the next record; -- moves back one record. I have the following code in the KeyPress event:
>>>
>>>IF nKeyCode = 13 .OR. nKeyCode = 9
>>> THIS.LostFocus() && Calc. & display the premium
>>> SKIP
>>> IF EOF()
>>> WAIT WINDOW AT 20,20 "Last advice on file for target date."
>>> SKIP -1
>>> ENDIF
>>> This.SetFocus()
>>>ENDIF
>>>IF nKeyCode = 15 && Shift--tab
>>> THIS.LostFocus()
>>> SKIP -1 IN Transact
>>> IF BOF()
>>> WAIT WINDOW AT 20,20 "First advice on file for target date."
>>> ENDIF
>>> THIS.SetFocus()
>>>ENDIF
>>>
>>>Doesn't work. All it does is wipe out the user's input and shift focus to the next column to the right. If I press the , everything works beautifully. What have I done wrong in my code? How can I make and emulate the key?
>>
>>I think that all you need is:
>>
>>DO CASE
>> CASE nKeyCode = 13 .OR. nKeyCode = 9
>> KEYBOARD "{DNARROW}"
>> CASE nKeyCode = 15
>> KEYBOARD "{UPARROW}"
>>ENDCASE
>>
>>Vlad
>
>Vlad:
>
>Thanks for kicking in here. Your code certainly gets me much closer to the desired behavior than mine! One thing is still wrong, however: while a TAB or ENTER now moves me down to the next row as desired, I continue to be shifted over to the next column. Using just DOWN ARROW moves me straight down, which is what I want. Any idea how to suppress the movement to the right?
>
>TIA.
>
>John

Sorry, this is the correct code:
DO CASE
   CASE nKeyCode = 13 .OR. nKeyCode = 9
      NODEFAULT
      KEYBOARD "{DNARROW}"
   CASE nKeyCode = 15
      NODEFAULT
      KEYBOARD "{UPARROW}"
ENDCASE
Vlad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform