I have a text box and four buttons.
I want the buttons "inactive" until the user types in the text box.
any suggestions?
thanks
Printable View
I have a text box and four buttons.
I want the buttons "inactive" until the user types in the text box.
any suggestions?
thanks
try this:
Code:Private Sub Text1_Change()
Command1.Visible = True
Command2.Visible = True
Command3.Visible = True
Command4.Visible = True
End Sub
Hello!
Do something like this.
Code:Private Sub Text1_Change()
command1.Enabled = True
End Sub
the subject was "hide" buttons
Sorry! He did use the word "inactive" too.
true
All of these ideas are great.
thanks.
ok, try this:
Code:'to hide the buttons:
Private Sub Text1_Change()
Command1.Visible = True
Command2.Visible = True
Command3.Visible = True
Command4.Visible = True
End Sub
'to disable the buttons:
Private Sub Form_Load()
Command1.enabled = false
Command2.enabled = false
Command3.enabled = false
Command4.enabled = false
End Sub
Private Sub Text1_Change()
Command1.enabled = True
Command1.enabled = True
Command1.enabled = True
Command1.enabled = True
End Sub
If you have a lot of them on your Form just use a For Each loop, it's a lot quicker.
If you want to make them Visible, just replace Enabled with Visible.Code:Private Sub Text1_Change()
Dim Obj As Object
For Each Obj In Controls
If TypeOf Obj Is CommandButton Then Obj.Enabled = True
Next Obj
End Sub
Quote:
pnj
I have a text box and four buttons.
I want the buttons "inactive" until the user types in the text box.
any suggestions?
thanks
Code:Private Sub Text1_Change()
If Not Text1.text = "" Then
Command1.enabled = True
Command2.enabled = True
Command3.enabled = True
Command4.enabled = True
Else
Command1.enabled = False
Command2.enabled = False
Command3.enabled = False
Command4.enabled = False
End If