<?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 : Popup command bars</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Popup command bars]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Fri, 17 Apr 2026 12:04:36 +0000</pubDate>
  <lastBuildDate>Wed, 23 Feb 2022 12:04:47 +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=24272</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[Popup command bars : Hi.I was trying to get a popup...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24272&amp;PID=78403&amp;title=popup-command-bars#78403</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=9542">AndyLUK</a><br /><strong>Subject:</strong> 24272<br /><strong>Posted:</strong> 23 February 2022 at 12:04pm<br /><br />Hi.<div>I was trying to get a popup menu to appear when clicking on a ReportControl column header.</div><div>After much experimenting and reverse engineering of the Codejock Samples I eventually got it to work.</div><div>It would be great if there was an introduction document to the use of these controls or a You tube video showing the basics for newbies but hey ho.</div><div>Anyway the code below is what I ended up with. I have documented the best I can and maybe it will be of some use to another newbie.</div><div>cheers</div><div>Andy</div><div><br></div><div><div>&nbsp;private void wndReportControl_ColumnClick(object sender, AxXtremeReportControl._DReportControlEvents_ColumnClickEvent e)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //this is if you right click on a column head - see SendContextMenuForWholeHeaderArea property if you want</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //all columns to have the same ColumnClick event</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //MessageBox.Show("col click");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LaunchPopup();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; private void LaunchPopup()</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //the following "using" statements are required</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //using XtremeReportControl;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //using XtremeCommandBars;</div><div><br></div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CommandBar popupbar;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CommandBarPopup popup2;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CommandBarControl control, pu_andy1, pu_andy2;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //N.B. you can't "new up" a command bar you need a command bar object on your form otherwise you</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //get a "Catastrophic COM failure ..." error when you run it.</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //create the base command bar and add some buttons - the ID class defines a unique number for each button</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //see Codejock samples</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; popupbar = axCommandBars1.Add("andy", XTPBarPosition.xtpBarPopup);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; popupbar.Controls.Add(XTPControlType.xtpControlButton, ID.FILE_NEW_FILE, "&amp;New", -1, false);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; popupbar.Controls.Add(XTPControlType.xtpControlButton, ID.FILE_OPEN_FILE, "&amp;Open", -1, false);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; popupbar.Controls.Add(XTPControlType.xtpControlButton, ID.FILE_SAVE, "&amp;Save", -1, false);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //need to define popup2 as a command bar and cast the control so we can add more controls to it.</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; popup2 = (CommandBarPopup)popupbar.Controls.Add(XTPControlType.xtpControlPopup, 9, "sub menu");</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //add controls to the sub menu</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pu_andy1 = popup2.CommandBar.Controls.Add(XTPControlType.xtpControlButton, 901, "andy1", -1, false);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pu_andy2 = popup2.CommandBar.Controls.Add(XTPControlType.xtpControlButton, 902, "andy2", -1, false);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //add divider and last control to main menu</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; control = popupbar.Controls.Add(XTPControlType.xtpControlButton, ID.FILE_PRINT, "&amp;Print", -1, false);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; control.BeginGroup = true;</div><div><br></div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //now setup the icons to use in the commandbar</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //you need an image control on the form</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; popupbar.CommandBars.Icons = axImageManager1.Icons;&nbsp; //using default name of axImageManager1</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //build an array to hold ID values</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int&#091;&#093; CommandBarIconArray = new int&#091;20&#093;;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //load array (ID values are defined in another class and are used to identify each control uniquely)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CommandBarIconArray&#091;0&#093; = ID.FILE_NEW_FILE;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CommandBarIconArray&#091;2&#093; = ID.FILE_OPEN_FILE;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CommandBarIconArray&#091;3&#093; = ID.FILE_SAVE;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CommandBarIconArray&#091;4&#093; = ID.FILE_SAVE_ALL;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CommandBarIconArray&#091;5&#093; = ID.FILE_PRINT;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //load the icons from the Toolbar.png file - see icons folder in codejock samples</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; popupbar.CommandBars.Icons.LoadBitmap(ID.IconsPath() + "Toolbar.png", CommandBarIconArray, XtremeCommandBars.XTPImageState.xtpImageNormal);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //display the popup - by default this is in the middle of the screen but there are coordinate parameters to "ShowPopup()</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; popupbar.ShowPopup();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div></div><div><br></div>]]>
   </description>
   <pubDate>Wed, 23 Feb 2022 12:04:47 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24272&amp;PID=78403&amp;title=popup-command-bars#78403</guid>
  </item> 
  <item>
   <title><![CDATA[Popup command bars : Hi.I am new to codejock and have...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24272&amp;PID=78401&amp;title=popup-command-bars#78401</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=9542">AndyLUK</a><br /><strong>Subject:</strong> 24272<br /><strong>Posted:</strong> 17 February 2022 at 3:45pm<br /><br />Hi.<div>I am new to codejock and have been struggling to get Popup Command Bars to work in C#.</div><div><br></div><div>It compiles OK but when I run the code I get a "Catastrophic COM failure ..."</div><div>I've clearly not understood the nuances of calling a Popup.</div><div>Can anyone help?</div><div>Cheers</div><div>Andy</div><div><br></div><div>My code is as follows.</div><div><br></div><div><div>private void LaunchPopup()</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CommandBars cmdbars;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CommandBar popupbar;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CommandBarControl control;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cmdbars = new CommandBars();&nbsp; &nbsp;//This doesn't work and the subsequent line throws the error</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; popupbar = cmdbars.Add("Popup", XTPBarPosition.xtpBarPopup);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; popupbar.Controls.Add(XTPControlType.xtpControlButton, 1, "&amp;New", -1, false);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; popupbar.Controls.Add(XTPControlType.xtpControlButton, 2, "&amp;Open", -1, false);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; popupbar.Controls.Add(XTPControlType.xtpControlButton, 3, "&amp;Save", -1, false);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; control = popupbar.Controls.Add(XTPControlType.xtpControlButton, 4, "&amp;Print", -1, false);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; control.BeginGroup = true;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; popupbar.ShowPopup();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div></div>]]>
   </description>
   <pubDate>Thu, 17 Feb 2022 15:45:14 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24272&amp;PID=78401&amp;title=popup-command-bars#78401</guid>
  </item> 
 </channel>
</rss>