Results 1 to 10 of 10

Thread: "hide" buttons? this is easy for the/Pros

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537
    I have a text box and four buttons.
    I want the buttons "inactive" until the user types in the text box.
    any suggestions?
    thanks
    pnj

  2. #2
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    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

  3. #3
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    Hello!
    Do something like this.

    Code:
    Private Sub Text1_Change()
      command1.Enabled = True
    End Sub
    Chemically Formulated As:
    Dr. Nitro

  4. #4
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    the subject was "hide" buttons
    NXSupport - Your one-stop source for computer help

  5. #5
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    Sorry! He did use the word "inactive" too.
    Chemically Formulated As:
    Dr. Nitro

  6. #6
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    true
    NXSupport - Your one-stop source for computer help

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537

    thats what I was looking for

    All of these ideas are great.
    thanks.
    pnj

  8. #8
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    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

  9. #9
    Guest
    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.

  10. #10
    Guest
    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
  •  



Click Here to Expand Forum to Full Width