ToolBar buttons by name?

T

Tom Williams

Surely there must be some way to refer to a button on a
toolbar by its name.

I don't mean when the button is clicked, I can see how to do
that.

Depending on what's going on, I want to enable or disable
certain buttons. For example, it the user hasn't done
anything, disable the "cancel" button. After they start
typing, enable the "Cancel" button. When there's nothing to
save, disable the "Save" button.

I'm not yet sure how many buttons I'll have and what order
they'll be in. So, if I have to hard code their index
number, adding, deleting or rearranging buttons will be a
pain in the toolbar.

tia
Tom
 
H

Herfried K. Wagner [MVP]

* Tom Williams said:
Depending on what's going on, I want to enable or disable
certain buttons. For example, it the user hasn't done
anything, disable the "cancel" button. After they start
typing, enable the "Cancel" button. When there's nothing to
save, disable the "Save" button.

\\\
Me.ToolBarButton5.Enabled = False
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top