Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Trouble finding a CommandBarControl by it
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Trouble finding a CommandBarControl by it

 Post Reply Post Reply
Author
Message
fernando View Drop Down
Groupie
Groupie
Avatar

Joined: 22 May 2006
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernando Quote  Post ReplyReply Direct Link To This Post Topic: Trouble finding a CommandBarControl by it
    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

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.