Print Page | Close Window

ActiveMenuBar.FindControl (ActiveX 8.6)

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=323
Printed Date: 27 September 2024 at 10:44am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ActiveMenuBar.FindControl (ActiveX 8.6)
Posted By: robs
Subject: ActiveMenuBar.FindControl (ActiveX 8.6)
Date Posted: 01 January 2004 at 12:11pm

Does anybody know how to find a menu through code when it's not a top-level menu item?

CommandBars.ActiveMenuBar.FindControl won't work because menus (controls of type xtpControlPopUp) all have an ID of 0 for some reason.
CommandBars.ActiveMenuBar.Controls.Count only has the count for top-level menu items.

Dim Control As XtremeCommandBars.CommandBarControl
For Each Control in CommandBars.ActiveMenuBar.Controls
  Debug.Print Control.Caption
next

Only lists the top-level menu items

I'm stumped. Every time I get by one obsticle I hit another. I was going to just use the .DescriptionText property of the menus to store ID's since the .ID property doesn't work, but if there is no way to cycle through the controls collection, it must be impossible.

What would be so dificult about making the .ID property for xtpControlPopup controls work?

Any ideas are appreciated. Yes, I've looked at the Dynamic Popups sample. CommandBars_InitCommandsPopup is just silly. That only allows access to menus as they are clicked.

Thanks!




Replies:
Posted By: robs
Date Posted: 01 January 2004 at 1:21pm

I guess the answer to my own questions is that controls that are not top-level popups should be xtpControlButtonPopUp and not xtpControlPopUp. The .id property does work on xtpControlButtonPopup and .FindControl will find them.

 



Posted By: Oleg
Date Posted: 03 January 2004 at 2:29am

You are right, you must set id manually in xtpControlPopup controls.

Control.Id = 20



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: future
Date Posted: 27 August 2007 at 6:01am
hi there ,Would u mind to provide some code that we can find the sub-menus, i am stock here as well, Thank u very much



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