Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Toggle cmdbutton on/off
Message
De
06/07/1998 15:28:55
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00114609
Message ID:
00114669
Vues:
23
>>>*Thisform.mycombobox1.enabled=!Thisform.combobox1.enabled
>>>sele 1
>>>use category
>>>thisform.mycombobox1.visible=.t.
>>>With Thisform.mycombobox1
>>> .RowSourceType=2
>>> .RowSource=""
>>> .rowsource= 'category'
>>> .Requery
>>>Endwith
>>>thisform.mylabels1.visible=.f.
>>>thisform.mytextbox2.visible=.f.
>>>thisform.mylabels2.visible=.f.
>>>thisform.mytextbox1.visible=.f.
>>>thisform.refresh
>>>Thisform.myCombobox1.value=category.kind
>>>
>>>clea
>>>?thisform.mycombobox1.visible=.t.
>>>wait
>>>if thisform.mycombobox1.visible=.t.
>>>thisform.mycombobox1.visible=.f.
>>>endi
>>>
>>>thisform.refresh
>>
>>I don't want to comment about all this code. However, it's enough to say that following part:
>>if thisform.mycombobox1.visible=.t.
>>thisform.mycombobox1.visible=.f.
>>endi
>>will always make the combo invisible.
>>I would advise you:
>>1. Cleanup this snippet
>>2. Write just one line of code:
>>Thisform.mycombobox1.visible=!Thisform.mycombobox1.visible
>>3. Test it and after you will be satisfied (i hope so) with the results, you can add some code to refill the combo. You should consider the opportunity to move code with combo definition (Rowsource etc.) to another place.
>
>Ed is the =! an operator or command. My clickable cmdbutton now only contains
>"Thisform.mycombobox1.visible=!Thisform.mycombobox1.visible" and the result is that when the cmdbutton is clicked, the combobx is forever invisible. Remember, I want it to toggle on and off with each cmdbutton click. Thanks.

'=' and '!' are different things. If you put exactly
Thisform.mycombobox1.visible= !Thisform.mycombobox1.visible
then it must work!
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform