Print Page | Close Window

would this be an issue?

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=2104
Printed Date: 24 May 2024 at 8:31am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: would this be an issue?
Posted By: leojay
Subject: would this be an issue?
Date 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?




Replies:
Posted By: leojay
Date 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.



Posted By: SuperMario
Date Posted: 10 April 2005 at 10:29pm
Yes, that is correct, you must manually assign the ID to popup controls.


Posted By: leojay
Date 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 mk:@MSITStore:C:\Program%20Files\Codejock%20Software\ActiveX\Xtreme%20Suite%20Pro%20ActiveX%20v9.60\help\SymbolReference.chm::/XtremeCommandBars~Enumerations~XTPControlType_EN.html - XTPControlType , _
   ByVal
Id As Long, _
   ByVal
Caption As String, _
   Optional ByVal
Before As Variant, _
   Optional ByVal
Temporary As Variant _
) As mk:@MSITStore:C:\Program%20Files\Codejock%20Software\ActiveX\Xtreme%20Suite%20Pro%20ActiveX%20v9.60\help\SymbolReference.chm::/XtremeCommandBars~CommandBarControl.html - 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?



Posted By: leojay
Date Posted: 24 April 2005 at 10:15pm
would this problem be fixed in the next release?


Posted By: nighthawk
Date 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.



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