ToolbarButton Name Property

  • Thread starter Thread starter Barry Gast
  • Start date Start date
B

Barry Gast

Hi. I am trying to access the names of the toolbar buttons in order to
match to correct button name passed to a function. However, there is no
..Name property on a ToolBarButton control. Is there any other way to access
the name of the toolbarbutton?

Thanks.

-Barry
 
Barry Gast said:
Hi. I am trying to access the names of the toolbar buttons in order
to match to correct button name passed to a function. However, there
is no .Name property on a ToolBarButton control. Is there any other
way to access the name of the toolbarbutton?

A ToolBarButton object does not have a name. References can be compared
using the Is operator, but why do you need this?
 
I am trying to setup user security on a form. I have a database of control
names that I want to enable or disable based on the user's access rights.
I've written a function that handles all the other control objects (text
boxes, grids, combo boxes, command buttons, etc.) But, I cannot get to the
tool bar buttons off of a name.

I guess for tool bar buttons, I could use the index to reference the button.
But then I'd also have to store the toolbar name in my database table, which
would require a table change. And we all know how much DBA's like to make
table changes... ;o)

-Barry
 
Barry Gast said:
I am trying to setup user security on a form. I have a database of
control names that I want to enable or disable based on the user's
access rights. I've written a function that handles all the other
control objects (text boxes, grids, combo boxes, command buttons,
etc.) But, I cannot get to the tool bar buttons off of a name.

I guess for tool bar buttons, I could use the index to reference the
button. But then I'd also have to store the toolbar name in my
database table,

I thought you *are* storing the toolbar name in the database.
which would require a table change. And we all know
how much DBA's like to make table changes... ;o)

:)

What about storing the ToolbarButton references in a Hashtable? Use the name
as the key.
 
The hash table is a good idea. I will explore that option. I will also
have to do this for menu items since they do not have an accessible name
property either.

Thanks.

-Barry
 
* "Barry Gast said:
Hi. I am trying to access the names of the toolbar buttons in order to
match to correct button name passed to a function. However, there is no
.Name property on a ToolBarButton control. Is there any other way to access
the name of the toolbarbutton?

\\\
Private Sub ToolBar1_ButtonClick( _
ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs _
) Handles ToolBar1.ButtonClick
Select Case True
Case e.Button Is Me.ToolBarButton1
 
Back
Top