Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Next & Previous Button Enabled/Disabled
Message
 
 
À
17/07/2013 08:45:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01578618
Message ID:
01578625
Vues:
77
>Greetings All,
>
>does anyone know of a good place to find a working navigation class? I can move my records but when at EOF or BOF, my Next, Prev buttons aren't enabling / disabling properly.
>
>Here is the code that I am using so far:
>
>Next Button Click
>IF !EOF()
> SKIP 1
> oVar.EmployeeId = pk_emp_id
>ENDIF
>
>IF EOF()
> GO BOTTOM
> skip 1
>ENDIF

I usually have the code of enabling/disabling nav buttons in Refresh method of the form. Something like this:
thisform.cmdNext.enable = .f.
thisform.cmdPrev.enable = .f.
if !eof()
   nRec = recno('alias_name')
   skip
   if !eof()
      thisform.cmdNext.enable = .T.
   endif 
   goto nRec in ALIAS_NAME
endif
if !bof()
   nRec = recno('alias_name')
   skip -1
   if !bof()
      thisform.cmdPrev.enable = .T.
   endif 
   goto nRec in ALIAS_NAME
endif
HTH
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform