Results 1 to 9 of 9

Thread: [RESOLVED] diasbling command buttons

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Location
    Sheffield
    Posts
    10

    Resolved [RESOLVED] diasbling command buttons

    hi,
    basically i need to have a command button disabled and when i press another button it enables it. also visa versa i need a button which diasbles already enabled command buttons.
    any tips?
    also, i need to be able to press a button, and any information in a label is then transferred into a list box.
    help!
    x.

  2. #2
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Arrow Re: diasbling command buttons

    VB Code:
    1. Private Sub Command2_Click()
    2. If Command1.Enabled = False Then
    3. Command1.Enabled = True
    4. Else
    5. Command1.Enabled = False
    6. End If
    7. End Sub
    8. Private Sub Form_Load()
    9. Command1.Enabled = False
    10. End Sub


  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Location
    Sheffield
    Posts
    10

    Re: diasbling command buttons

    that should work out great, thanks!
    now i just need to get that "pressing a command button, which transfers text from a lable into a list box" sorted! hehe.
    x.

  4. #4
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: diasbling command buttons

    VB Code:
    1. Private Sub Command2_Click()
    2.     Command1.Enabled = Not Command1.Enabled
    3. End Sub
    4.  
    5. Private Sub Command1_Click()
    6.     List1.AddItem Label1.Caption
    7. End Sub
    8.  
    9. Private Sub Form_Load()
    10.     Command1.Enabled = False
    11. End Sub

  5. #5
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Arrow Re: diasbling command buttons

    your solution at above
    keep touch in forums
    thanks

  6. #6

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Location
    Sheffield
    Posts
    10

    Re: diasbling command buttons

    the list box works great now, cheers.
    i tried the code for the command button and i don't think i explained myself too well, i need let's call it button X to be disabled permanently, until i press button Y which then enables it. then i press button X and it becomes disabled again until i press button Y.
    many thanks, you're saving my sanity .
    x.

  7. #7
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: diasbling command buttons

    VB Code:
    1. Private Sub Command2_Click()
    2.     Command1.Enabled = True
    3. End Sub
    4.  
    5. Private Sub Command1_Click()
    6.     List1.AddItem Label1.Caption
    7.     Command1.Enabled = False
    8. End Sub
    9.  
    10. Private Sub Form_Load()
    11.     Command1.Enabled = False
    12. End Sub

  8. #8

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Location
    Sheffield
    Posts
    10

    Re: diasbling command buttons

    works great!
    cheers!!

  9. #9
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: diasbling command buttons



    Don't forget to mark this thread resolved by using the thread tools just above your first post

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