<?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 : MDI with popup Menu</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : MDI with popup Menu]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 14 Jun 2026 23:37:12 +0000</pubDate>
  <lastBuildDate>Fri, 19 Jun 2009 21:15:46 +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=14578</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[MDI with popup Menu :    I have the below code in...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14578&amp;PID=50133&amp;title=mdi-with-popup-menu#50133</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4182">rplp4</a><br /><strong>Subject:</strong> 14578<br /><strong>Posted:</strong> 19 June 2009 at 9:15pm<br /><br /><DIV></DIV><FONT size=2><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2></P><DIV>&nbsp;</DIV><DIV>I have the below code in <FONT size=2>SyntaxEdit Mouse Up.&nbsp;&nbsp; When I right click on the Syntax control I do get the menu to pop up and it does work on the MDI form <FONT size=2>CommandBars_Execute the ID is correct but wheen I try with the code <FONT size=2>GetDocument.AxSyntaxEdit1.Copy() It does not.&nbsp;&nbsp; See Code for the Execute below.&nbsp;&nbsp; Why does it not work??</FONT></FONT></FONT></DIV><DIV>&nbsp;</DIV><DIV>In the popup click the&nbsp; <FONT color=#000000>MdiChildren.Length </FONT><FONT color=#0000ff>returns 0&nbsp; but when I click the button on the ribbon </FONT><FONT color=#000000>MdiChildren.Length </FONT><FONT color=#0000ff>returns the correct </FONT></DIV><DIV><FONT color=#0000ff>number.</FONT></DIV><DIV>VB.net 2008</DIV><DIV><table width="99%"><tr><td><pre class="BBcode"></DIV><DIV>Dim</FONT></FONT><FONT size=2> Popup </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> XtremeCommandBars.CommandBar</DIV><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> Control </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> XtremeCommandBars.CommandBarControl</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>If</FONT></FONT><FONT size=2> (e.button = 2) </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Then</P></FONT></FONT><FONT size=2><P>BringToFront()</P><P>Popup = frmMain.CommandBars.Add(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"Popup"</FONT></FONT><FONT size=2>, XtremeCommandBars.XTPBarPosition.xtpBarPopup)</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>With</FONT></FONT><FONT size=2> Popup.Controls</P><P>.Add(XtremeCommandBars.XTPControlType.xtpControlButton, ID_EDIT_CUT, </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"Cu&amp;t"</FONT></FONT><FONT size=2>, -1, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>False</FONT></FONT><FONT size=2>)</P><P>.Add(XtremeCommandBars.XTPControlType.xtpControlButton, ID_EDIT_COPY, </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"&amp;Copy"</FONT></FONT><FONT size=2>, -1, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>False</FONT></FONT><FONT size=2>)</P><P>.Add(XtremeCommandBars.XTPControlType.xtpControlButton, ID_EDIT_PASTE, </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"&amp;Paste"</FONT></FONT><FONT size=2>, -1, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>False</FONT></FONT><FONT size=2>)</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>End</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>With</P></FONT></FONT><FONT size=2><P>Popup.ShowPopup()</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>End</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>If</P><DIV></DIV></pre></td></tr></table> <DIV>&nbsp;</DIV><DIV>Execute CODE</DIV><DIV><DIV></DIV><DIV></DIV><DIV></DIV><table width="99%"><tr><td><pre class="BBcode"></DIV><DIV></DIV><FONT size=2><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>'This is buttons on the menu ribbon bar</P><DIV>&nbsp;<P>'''''Me<FONT size=2><FONT color=#000000>.MdiChildren returns returns the correct number of forms</FONT></P></FONT></FONT></FONT><FONT size=2></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2></FONT></FONT></DIV><DIV><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Case</FONT></FONT><FONT size=2> ID.ID_EDIT_CUT : GetDocument.AxSyntaxEdit1.Cut()</DIV><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Case</FONT></FONT><FONT size=2> ID.ID_EDIT_COPY : GetDocument.AxSyntaxEdit1.Copy()</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Case</FONT></FONT><FONT size=2> ID.ID_EDIT_PASTE : GetDocument.AxSyntaxEdit1.Paste()</P><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>'This is for pop up menu</P></FONT></FONT><FONT size=2><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Case</FONT></FONT><FONT size=2> ID_EDIT_CUT</P><DIV><FONT color=#0000ff size=2><FONT color=#0000ff size=2><P>'''''Me</FONT></FONT><FONT size=2><FONT color=#000000>.MdiChildren returns</FONT></P></FONT></DIV><DIV>MessageBox.Show(eventArgs.control.Caption &amp; </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>" clicked"</FONT></FONT><FONT size=2>, </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"Button Clicked"</FONT></FONT><FONT size=2>)</DIV><P>GetDocument.AxSyntaxEdit1.Cut()</P><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>'A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll</P></FONT></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>'A first chance exception of type 'System.NullReferenceException' occurred in Pad.exe</P></FONT></FONT><FONT size=2><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Case</FONT></FONT><FONT size=2> ID_EDIT_COPY</P><P>MessageBox.Show(eventArgs.control.Caption &amp; </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>" clicked"</FONT></FONT><FONT size=2>, </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"Button Clicked"</FONT></FONT><FONT size=2>) 'Gets here</P><P>GetDocument.AxSyntaxEdit1.Copy() 'error here</P><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>'A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll</P></FONT></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>'A first chance exception of type 'System.NullReferenceException' occurred in CNC Pad.exe</P></FONT></FONT><FONT size=2><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Case</FONT></FONT><FONT size=2> ID_EDIT_PASTE</P><P>MessageBox.Show(eventArgs.control.Caption &amp; </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>" clicked"</FONT></FONT><FONT size=2>, </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"Button Clicked"</FONT></FONT><FONT size=2>)</P><P>GetDocument.AxSyntaxEdit1.Paste()</P><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>'A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll</P></FONT></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>'A first chance exception of type 'System.NullReferenceException' occurred in Pad.exe</P><DIV></pre></td></tr></table></DIV></FONT></FONT></FONT></FONT>]]>
   </description>
   <pubDate>Fri, 19 Jun 2009 21:15:46 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14578&amp;PID=50133&amp;title=mdi-with-popup-menu#50133</guid>
  </item> 
 </channel>
</rss>