Information générale
Catégorie:
Codage, syntaxe et commandes
The When code for each of the grid objects, such as your textboxes, combos, etc. will fire when the user clicks on a grid line. In order to hilite the line you are probably already storing either recno() or key information in a property during the When of each object. Perhaps you aren't. Try this:
- Add a property to the form class, say, Thisform.r_nRowNow_xx.
- Add a method: Thisform.m_NavCmdEnable
When (for each object in the grid)
*---------------------------------------
Thisform.r_nRowNow_xx = xx_table.xx_key
* Where xx_key is you Primary Key field. If you don't have one,
* use: Thisform.r_nRowNow_xx = Recno('xx_table')
Thisform.m_NavCmdEnable
Method Code: m_NavCmdEnable
*--------------------------
Local l_lEnableNext, l_lEnablePrevious
* Now it depends what you want to test.
* If you want to see if this is the last or first record
* you can have a second copy of the table xx_table opened under
* an alias (xx_2), and go to the same record using the r_nRowNow_xx property
* to find it. Then SKIP and see if EOF('xx_2') is true...
* When you have the values of l_lEnableXXXX set, just set the
* Enabled property of the respective buttons to those values
* and refresh the buttons:
* 1. Make your tests
* 2. Reset buttons:
With Thisform
.cmdNext.Enabled = l_lEnableNext
.cmdPrev.Enabled = l_lEnablePrev
.cmdNext.Refresh
.cmdPrev.Refresh
EndWith
*******************************EndMethod m_NavCmdEnable
-Adam
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement