Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Toggle cmdbutton on/off
Message
 
To
06/07/1998 14:03:27
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00114609
Message ID:
00114668
Views:
17
>>*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.
"Build a man a fire, and he's warm for a day.
Set a man on fire, and he's warm for the rest of his life."
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform