Results 1 to 3 of 3

Thread: Enabled property on toolbar????

  1. #1

    Thread Starter
    Hyperactive Member mikef's Avatar
    Join Date
    Jun 2000
    Location
    Beach bound...
    Posts
    510

    Question

    I have a standard toolbar with Cut, Copy and Paste on them. I have them disabled/grayed when the program starts and want to know how to enable them when the user enters Edit Mode and then disable them again when the user exits Edit Mode. Thanks for any input....my forehead is getting sore and the monitor can't take much more!

  2. #2
    Guest
    To Enabled and Disable a Button?

    Code:
    'To ENABLE the Buttons
    For I = 1 To Toolbar1.Buttons.Count
        Toolbar1.Buttons.Item(I).Enabled = True
    Next I
    
    'To DISABLE the Buttons
    For I = 1 To Toolbar1.Buttons.Count
        Toolbar1.Buttons.Item(I).Enabled = False
    Next I
    [Edited by Megatron on 07-13-2000 at 05:52 PM]

  3. #3
    Guest

    Lightbulb Forgot.

    I just re-looked at your question. What did you mean by Edit Mode? Did you mean when someone uses a TextBox? If so, just put the above code in the GotFocus and LostFocus events of the TextBox.

    Code:
    Private Sub Text1_GotFocus()
    
        'Enables the Button when the TextBox gets the Focus
        For I = 1 To Toolbar1.Buttons.Count
            Toolbar1.Buttons.Item(I).Enabled = True
        Next I
        
    End Sub
    
    Private Sub Text1_LostFocus()
    
        'Disabled the Buttn when the TextBox gets the Focus
        For I = 1 To Toolbar1.Buttons.Count
            Toolbar1.Buttons.Item(I).Enabled = False
        Next I
        
    End Sub

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