By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,219 Members | 2,140 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,219 IT Pros & Developers. It's quick & easy.

ToolbarButton Name Property

P: n/a
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
Nov 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"Barry Gast" <ba****@nycap.rr.com> schrieb
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?
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2

P: n/a
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
"Armin Zingler" <az*******@freenet.de> wrote in message
news:el**************@TK2MSFTNGP09.phx.gbl...
"Barry Gast" <ba****@nycap.rr.com> schrieb
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?
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3

P: n/a
"Barry Gast" <ba****@nycap.rr.com> schrieb
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.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #4

P: n/a
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

"Armin Zingler" <az*******@freenet.de> wrote in message
news:uS*************@tk2msftngp13.phx.gbl...
"Barry Gast" <ba****@nycap.rr.com> schrieb
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.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #5

P: n/a
* "Barry Gast" <ba****@nycap.rr.com> scripsit:
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
Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.