<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Trying to delete a popup menu</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Trying to delete a popup menu]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 15:47:22 +0000</pubDate>
  <lastBuildDate>Wed, 29 Oct 2008 15:22:16 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=12539</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Trying to delete a popup menu : Thanks for the reply. I am able...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12539&amp;PID=42473&amp;title=trying-to-delete-a-popup-menu#42473</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4463">MadRiver</a><br /><strong>Subject:</strong> 12539<br /><strong>Posted:</strong> 29 October 2008 at 3:22pm<br /><br />Thanks for the reply.<br />I am able to delete the menu if it is only one level deep, but I'm not sure I have the most efficient approach.<br />When I find the menuItem to remove, I get its parent, a CommandBarPopup control.  Do I have to traverse all the controls in the top-level CommandBar, looking for the Control with the matching CommandBar?  <br /><br />I also need to handle hierarchical menus, and I am having trouble traveling up the hierarchy.<br /><br /><br />For example:<br />TopLevel<br />----Level1<br />--------Level2<br />------------MenuItem1<br /><br />When I delete MenuItem1, I want to see if its 'parent' (Level2) is empty, and delete it if it is.  Similarly, I want to get Level2's parent, and delete it if it is empty, and so on.<br />Is there a straightforward way to do this?&nbsp;&nbsp;&nbsp;<br />]]>
   </description>
   <pubDate>Wed, 29 Oct 2008 15:22:16 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12539&amp;PID=42473&amp;title=trying-to-delete-a-popup-menu#42473</guid>
  </item> 
  <item>
   <title><![CDATA[Trying to delete a popup menu : Hi,  pParent is PopupBar of...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12539&amp;PID=42377&amp;title=trying-to-delete-a-popup-menu#42377</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 12539<br /><strong>Posted:</strong> 27 October 2008 at 10:49am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>pParent is PopupBar of Control. You need Delete not PopupBar but Control that has this Popupbar as Child CommandBar. so Find it and remove.</DIV>]]>
   </description>
   <pubDate>Mon, 27 Oct 2008 10:49:54 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12539&amp;PID=42377&amp;title=trying-to-delete-a-popup-menu#42377</guid>
  </item> 
  <item>
   <title><![CDATA[Trying to delete a popup menu : Hello,  My application allows...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12539&amp;PID=42373&amp;title=trying-to-delete-a-popup-menu#42373</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4463">MadRiver</a><br /><strong>Subject:</strong> 12539<br /><strong>Posted:</strong> 27 October 2008 at 9:46am<br /><br />Hello,<br /><br />My application allows users to add and remove menu items via scripting.  When all the menu items are removed from a particular menu, I would like to remove the menu.<br /><br />Currently, I try to a find a menu item by ID, confirm that it is CommandBarButton, then delete it:<br />  pControl-&gt;Delete();<br /><br />Before deleting, I get the control's parent:<br />  ICommandBar * pParent = pControl-&gt;GetParent();<br />  // xtpBarTypePopup == pParent-&gt;GetType();<br />  long cnt = pParent-&gt;GetControls()-&gt;GetCount();<br />  if (0 == cnt) {<br />&nbsp;&nbsp;&nbsp;&nbsp;pParent-&gt;Delete();<br />  }<br />This call to Delete() crashes.<br />What am I doing wrong?<br />Thanks for any insight...<br /><br />]]>
   </description>
   <pubDate>Mon, 27 Oct 2008 09:46:35 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12539&amp;PID=42373&amp;title=trying-to-delete-a-popup-menu#42373</guid>
  </item> 
 </channel>
</rss>