Print Page | Close Window

How to remove a sub-menu item

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=2269
Printed Date: 08 November 2025 at 6:04am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to remove a sub-menu item
Posted By: thodgson
Subject: How to remove a sub-menu item
Date Posted: 23 May 2005 at 12:24pm

The following code will remove a command that is just below a top level menu, e.g. File -> Open, however if you try and remove one level below that, an ASSERT is thrown.

How do I remove a menu item (control) that is 2 levels down, e.g. File -> Open -> Something?

OnInitCommandsPopup(CXTPCommandBar* pCommandBar)
{
   CXTPControl* pCommandSubItem = pCommandList->FindControl(xtpControlButton, ID_TOOLS_SUBITEM, TRUE, TRUE);
   if (pCommandSubItem)
   {
       pCommandList->Remove(pCommandSubItem);
   }
}



-------------
Tim H( http://www.ExclamationSoft.com - http://www.ExclamationSoft.com )
Product: Xtreme Toolkit v13.1
Platform: Vista(x64)-SP1
Language: Visual C++ 6.0
Currently: Satisfied w/ Toolkit



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