Information générale
Catégorie:
Gestionnaire d'écran & Écrans
>>>>If this can be solved. I have a combobox and a textbox and only one can be active at once. If the textbox has any input in it, the combobox should be dis-enabled so in the interactive exchange have:
>>>>if len(thisform.somectls1.mytextbox1.value)>0
>>>>thisform.somectls1.mycombobox2.enabled=.f.
>>>>else
>>>>thisform.somectls1.mycombobox2.enabled=.t.
>>>>endi
>>>>SO I test it by enter a little text in the txtbox and the combo becomes disabled like it's supposed to but when I backspace and remove the text from the said txtbox the combobox never becomes enabled.
>>>
>>>Use following:
>>>if not empty(thisform.somectls1.mytextbox1.value)
>>>etc.
>>>Also, if it's the same textbox.interactivechange then use just
>>>if not empty(this.value)
>>>...
>>
>>A little improvement: instead of an IF, use directly
>>
>>THISFORM.SOMECTLS1.MYCOMBOBOX2.ENABLED = EMPTY(THIS.VALUE)
>>
>>Any structure like
>>
>>IF condition
>> SOMETHING = .T.
>>ELSE
>> SOMETHING = .F.
>>ENDIF
>>
>>is better coded (IMO) as SOMETHING = condition.
>
>That worked!! PS IMO???
IMO = In My Opinion. Also seen as IMHO (In My HUMBLE Opinion) which usually means the writer doesn´t actually feel very H (if any H at all).
:-)
Précédent
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