hello,
I have a combobox and a label.
I don't know why this doesn't work:
VB Code:
Private Sub cmbChoice_Change() If cmbChoice.ListIndex = 0 Then Label1.Visible = False Else Label1.Visible = True End If End Sub
what is the problem?
thanks
:wave:
Printable View
hello,
I have a combobox and a label.
I don't know why this doesn't work:
VB Code:
Private Sub cmbChoice_Change() If cmbChoice.ListIndex = 0 Then Label1.Visible = False Else Label1.Visible = True End If End Sub
what is the problem?
thanks
:wave:
Place the code in the click event handler. Change is triggered when you type to the combo.
I used to have the same problem. Now I use:
VB Code:
Private Sub Combo1_LostFocus()
Why would you use lostfocus and not the _click event? Assuming he wants to hide a label if some condition is true on click...