Print Page | Close Window

Need to remove a sub-menu item

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=10464
Printed Date: 21 November 2024 at 2:27pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Need to remove a sub-menu item
Posted By: 71SoCal
Subject: Need to remove a sub-menu item
Date Posted: 02 May 2008 at 7:32pm
How do I delete a sub-menu item?
 
I'm talking about a sub-menu item from a standard dropdown menu (menu item cascades to the right-side with an arrow indicating a sub-menu).
 
Once I've got the CXTPControl* object for the menu item, if I do the following code, it blows up:
 
 
// Get the control object from the menu item
CXTPControl* pControl = pControls->GetAt(nIndex);
if (pControl)
{
   // Trying here to get the sub-menu controls...
   CXTPControls* pSubMenuControls =
   pControl->GetCommandBar()->GetControls();  // Blows up!!!
}
 
My plan was to get the pSubMenuControls object, then call:
CXTPControl* pSubControl = pSubControls->FindControl(nID);
if (pSubControl)
{
   pSubControls->Remove(pSubControl);
}
 
Thanks for any help on this one!
 
Mike




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