-
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!
-
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]
-
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