Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - would this be an issue?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

would this be an issue?

 Post Reply Post Reply
Author
Message
leojay View Drop Down
Groupie
Groupie


Joined: 07 March 2005
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote leojay Quote  Post ReplyReply Direct Link To This Post Topic: would this be an issue?
    Posted: 10 April 2005 at 8:33pm

after running this code:

Set mnuTools = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, ID_MENU_TOOL, "Tools")
Set mnuTools = CommandBars.FindControl(xtpControlPopup, ID_MENU_TOOL, , True)


the mnuTools is Nothing. it's, of course, incorrect.

but if I run this:


Set mnuTools = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, ID_MENU_TOOL, "Tools")
mnuTools.Id = ID_MENU_TOOL
Set mnuTools = CommandBars.FindControl(xtpControlPopup, ID_MENU_TOOL, , True)

the mnuTools will be correct.

I wonder why

The procedure Add won't set the id of the new CommandBar?

would this be an issue?

Back to Top
leojay View Drop Down
Groupie
Groupie


Joined: 07 March 2005
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote leojay Quote  Post ReplyReply Direct Link To This Post Posted: 10 April 2005 at 8:46pm

i don't know whether the description is clear or not.

what i mean is i must set the id of a new CommandBar manually, otherwise the FindControl will return Nothing.

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: 10 April 2005 at 10:29pm
Yes, that is correct, you must manually assign the ID to popup controls.
Back to Top
leojay View Drop Down
Groupie
Groupie


Joined: 07 March 2005
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote leojay Quote  Post ReplyReply Direct Link To This Post Posted: 10 April 2005 at 11:34pm

Originally posted by SuperMario SuperMario wrote:

Yes, that is correct, you must manually assign the ID to popup controls.

since the prototype of  Add is:


Public Function Add( _
   ByVal Type As XTPControlType, _
   ByVal Id As Long, _
   ByVal Caption As String, _
   Optional ByVal Before As Variant, _
   Optional ByVal Temporary As Variant _
) As CommandBarControl

after calling Add, the new CommandBarControl's ID should be set automatically by the literal meaning of the second parameter of Add, shouldn't it?

Back to Top
leojay View Drop Down
Groupie
Groupie


Joined: 07 March 2005
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote leojay Quote  Post ReplyReply Direct Link To This Post Posted: 24 April 2005 at 10:15pm
would this problem be fixed in the next release?
Back to Top
nighthawk View Drop Down
Senior Member
Senior Member
Avatar

Joined: 11 June 2004
Status: Offline
Points: 167
Post Options Post Options   Thanks (0) Thanks(0)   Quote nighthawk Quote  Post ReplyReply Direct Link To This Post Posted: 25 April 2005 at 2:15am
This has been a well known problem since forever.  (Or at least for the past year and a half, based on forum posts.)  I'm really surprised it hasn't been fixed.
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.203 seconds.