Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid behave as normal textboxes do (tabbing)
Message
 
À
15/06/2005 10:28:15
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 6 SP5
Divers
Thread ID:
01023485
Message ID:
01029484
Vues:
13
Hi Hilmar

Sorry to pick up an old thread, for that I am keeping all the old response below for your reference.

As per your advise I have tried the following stuff. I have created a lLastRowColExit property so as to make this function discretionary

Grid.AfterRowColChange()
LPARAMETERS tnColIndex

WITH THIS
...
	*** 06/07/2005 as suggested by Hilmar on UT
	***            Also, about the last Column, I was forgetting a possible
	***            complication: The user might re-order the columns - just
	***            by dragging the headers with the mouse. You may want to
	***            disable this, to keep it simple.
	IF .lLastRowColExit AND tnColIndex = .COLUMNCOUNT AND .LastRow()
		KEYBOARD "{TAB}{Ctrl+TAB}"
	ENDIF
ENDWITH
Assuming I have flagged lLastRowColExit = .T. then the last row's last col is never allowed to be entered into.

Plus I noticed another thing that as the row col is remembered in the grid the next time I tab into the same grid it automatically exits the grid. To counter it as you might have noticed I have put in an extra {TAB} in the keyboard statement but I have not been able to enter the last textbox of the last row :(

Also I have a grid with only one column active and one row (this is a grid with precreated fixed rows, which is 1 row and out of it's 4 columns only the last column is enabled for data-entry). This grid is never allowed to be used and the KEYBOARD fires.

Please advise on how to circumvent these problems.

>Oh, you wanted that behaviour only for the last record and field? I thought you wanted to navigate through the Grid with another key.
>
>Last field: You might do the check only in the last Column.
>
>Last record: If the table or cursor does not have an active index, a filter, nor deleted records, you can check whether recno() = reccount(). Otherwise, you will need to invoke a UDF or method that tries to skip to the next record. Something like this:
>
>
>if LastRow()
>  keyboard "{Ctrl+TAB}"
>endif
>
>function LastRow() && in separate PRG - might also be ThisForm.LastRow()
>  local lnSaveRecord, llReturnValue
>  lnSaveRecord = recno()
>  skip
>  llReturnValue = eof()
>  goto (lnSaveRecord)
>  return llReturnValue
>endfunc
>
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform