Groups | Blog | Home
all groups > vb.net controls > november 2005 >

vb.net controls : Toolbar


Lou
11/2/2005 10:46:02 AM
How can I set a toolbar item by name instead of index
ToolBar1.Buttons(17).Pushed =True

I want to do this

ToolBar1.Buttons("MyButtonName").Pushed =True

This doesn't work

-Lou

Herfried K. Wagner [MVP]
11/2/2005 7:50:10 PM
"Lou" <lou.garvin@comcast.net> schrieb:
[quoted text, click to view]

Add all toolbar buttons to a 'Hashtable' and use the name as key and the
reference to the 'ToolbarButton' object as value. Then you can easily
lookup a button by its name.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
AddThis Social Bookmark Button