jeu. 22 mai 2014, 20h06
Saline_108
France
atoutfox.public.association
PROCEDURE // THISFORM
j'ai cree cette procedure dans une classe
PROCEDURE affiche_btn
PARAMETER nombtn1, nombtn2, nombtn3
***Nombre des controles
i=thisform.controlcount
*** Parcourir tous les btns :
DO while i<>0
*** specifie la classe des boutons
IF ALLTRIM(UPPER(thisform.controls(i).baseclass))="COMMANDBUTTON"
***si le bouton porte le nom X rendre visible
DO CASE
CASE ALLTRIM(thisform.controls(i).name)=ALLTRIM(nombtn1)
thisform.Controls(i).visible = .T.
CASE ALLTRIM(thisform.controls(i).name)=ALLTRIM(nombtn2)
thisform.Controls(i).visible = .T.
CASE ALLTRIM(thisform.controls(i).name)=ALLTRIM(nombtn3)
thisform.Controls(i).visible = .T.
OTHERWISE
thisform.Controls(i).visible = .F.
ENDCASE
ENDIF
i = i-1
ENDDO
ENDPROC
******** dans un bouton j'ai fais comme sa
do affiche_btn with "nombtn1","nombtn2", "nombtn3"
Msg Erreur : thisform peut etre utilisé uniquement dans une methode
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000014505