Print Page | Close Window

Trouble finding a CommandBarControl by it

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=4403
Printed Date: 21 June 2025 at 7:10am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Trouble finding a CommandBarControl by it
Posted By: fernando
Subject: Trouble finding a CommandBarControl by it
Date Posted: 13 June 2006 at 7:05pm
Hi,

What's the best way to retrieve a CommandBarControl from a CommandBar by its ID?

I tried the following, but it didn't work:

----------------------------------------------------
Dim rc As CommandBarControl
Set rc = m_rMenuBar.Controls.Find(, eFile, , 1)
----------------------------------------------------

The ID is eFile and the commandbarcontrol is there. However, the Find method always returns Nothing

What am I doing wrong???

Thanks




Replies:
Posted By: SuperMario
Date Posted: 14 June 2006 at 8:51am
I assume eFile is a popupcontrol?  If so, you must amnually assign it an id.

Set ControlFile = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "&File", -1, False)
    ControlFile.Id = 101

It will ignore what is passed in to the Add method.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net