|
-
Jul 5th, 2000, 11:45 AM
#1
Thread Starter
Fanatic Member
I have a text box and four buttons.
I want the buttons "inactive" until the user types in the text box.
any suggestions?
thanks
-
Jul 5th, 2000, 11:46 AM
#2
Frenzied Member
try this:
Code:
Private Sub Text1_Change()
Command1.Visible = True
Command2.Visible = True
Command3.Visible = True
Command4.Visible = True
End Sub
NXSupport - Your one-stop source for computer help
-
Jul 5th, 2000, 11:47 AM
#3
Fanatic Member
Hello!
Do something like this.
Code:
Private Sub Text1_Change()
command1.Enabled = True
End Sub
Chemically Formulated As:
Dr. Nitro
-
Jul 5th, 2000, 11:48 AM
#4
Frenzied Member
the subject was "hide" buttons
NXSupport - Your one-stop source for computer help
-
Jul 5th, 2000, 11:50 AM
#5
Fanatic Member
Sorry! He did use the word "inactive" too.
Chemically Formulated As:
Dr. Nitro
-
Jul 5th, 2000, 11:53 AM
#6
Frenzied Member
NXSupport - Your one-stop source for computer help
-
Jul 5th, 2000, 11:54 AM
#7
Thread Starter
Fanatic Member
thats what I was looking for
All of these ideas are great.
thanks.
-
Jul 5th, 2000, 11:56 AM
#8
Frenzied Member
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
NXSupport - Your one-stop source for computer help
-
Jul 5th, 2000, 12:08 PM
#9
If you have a lot of them on your Form just use a For Each loop, it's a lot quicker.
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
If you want to make them Visible, just replace Enabled with Visible.
-
Jul 6th, 2000, 01:36 AM
#10
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|