Welcome Guest Search | Active Topics | Sign In | Register

Setting Toolbar Item properties Options
Lee Bornstein
Posted: Thursday, November 12, 2009 6:55:33 AM
Rank: Newbie
Groups: Member

Joined: 11/9/2009
Posts: 5

I know that Toolbar.Items(3).Disabled=True will disable the fourth button.

Now, if the fourth button has CommandName of "Delete" how do I disable it by Name rather than by Index?

Thanks in Advance!

Lee

eo_support
Posted: Thursday, November 12, 2009 8:56:55 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

I believe you will need to loop through all items to find out the index first.

Thanks!
Lee Bornstein
Posted: Thursday, November 12, 2009 10:00:13 PM
Rank: Newbie
Groups: Member

Joined: 11/9/2009
Posts: 5
I guess I can use the following unless you have better suggestion:

toolbar1.items(KeyIndex("Delete")).disabled=true


Function KeyIndex(ByVal KeyName As String) As Short
Dim iCount As Short
For iCount = 0 To ToolBar1.Items.Count - 1
If ToolBar1.Items(iCount).Text = KeyName Then Exit For
Next
Return iCount
End Function
eo_support
Posted: Thursday, November 12, 2009 11:14:50 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Yes. That's the best way to do it. Thanks for sharing!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.