<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Link toolbar button to event in code</title><link>https://www.infopathdev.com:443/forums/thread/55152.aspx</link><pubDate>Thu, 20 May 2010 21:07:37 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:55152</guid><dc:creator>schan</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/55152.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=55152</wfw:commentRss><description>&lt;p&gt;I am getting into the same issue. I managed to find a get around, to use InfoPath 2003 object model instead of InfoPath 2007 object model.&lt;/p&gt;
&lt;p&gt;Go to Form, Options and set the Form template code language to C# (InfoPath 2003 Compatible) and add the following code,&lt;/p&gt;
&lt;p&gt;[InfoPathEventHandler(MatchPath = &amp;quot;btnHello&amp;quot;, EventType = InfoPathEventType.OnClick)]&lt;br /&gt;public void btnHello_OnClick(DocActionEvent e)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; thisXDocument.UI.Alert(&amp;quot;Hello&amp;quot;);&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m still trying to find&amp;nbsp;the proper way to use the InfoPath 2007 object model to register the event handler of a custom toolbar button.&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Link toolbar button to event in code</title><link>https://www.infopathdev.com:443/forums/thread/52114.aspx</link><pubDate>Wed, 24 Feb 2010 10:07:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:52114</guid><dc:creator>h3rb4l</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/52114.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=52114</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi,&lt;/p&gt;&lt;p&gt;Is there any progress with this one?&lt;/p&gt;&lt;p&gt;Have you managed to find any solution?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Regards,&lt;/p&gt;&lt;p&gt;h3rb4l &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Link toolbar button to event in code</title><link>https://www.infopathdev.com:443/forums/thread/31452.aspx</link><pubDate>Thu, 14 Aug 2008 09:05:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:31452</guid><dc:creator>totoen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/31452.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=31452</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Nobody make custom toolbar?&lt;/p&gt;
&lt;p&gt;In this article it&amp;#39;s explain how to make custom&amp;nbsp;toolbar:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb251008.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb251008.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;But nothing is say about how to bind it with the C# code.&lt;/p&gt;
&lt;p&gt;Please help me, Thanks!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Link toolbar button to event in code</title><link>https://www.infopathdev.com:443/forums/thread/31360.aspx</link><pubDate>Tue, 12 Aug 2008 06:57:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:31360</guid><dc:creator>totoen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/31360.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=31360</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I have a form that I want to convert (2003 to 2007) but now the button on my&amp;nbsp;custom toolbar doesn&amp;#39;t firing.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;When I&amp;nbsp;click on one of my toolbar button nothing is doing (this was good working before the conversion). Can you help me?&lt;/p&gt;
&lt;p&gt;I use VS 2005, &amp;nbsp;Infopath 2007 with C#.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The declaration in the manifest:&lt;/p&gt;&lt;font color="#0000ff"&gt;
&lt;p&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000"&gt;xsf:button&lt;/font&gt;&lt;font color="#ff0000"&gt; name&lt;/font&gt;&lt;font color="#0000ff"&gt;=&amp;quot;&lt;/font&gt;Quit&lt;font color="#0000ff"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#ff0000"&gt; caption&lt;/font&gt;&lt;font color="#0000ff"&gt;=&amp;quot;&lt;/font&gt;Abbrechen&lt;font color="#0000ff"&gt;&amp;quot;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;font color="#800000"&gt;xsf:button&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;The link to the event in the internal startup:&lt;/font&gt;&lt;/p&gt;&lt;font color="#0000ff"&gt;&lt;font size="2"&gt;
&lt;p&gt;((&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;ButtonEvent&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)EventManager.ControlEvents[&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;Quit&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;]).Clicked += &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;ClickedEventHandler&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(Quit_Clicked);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;the event in my code:&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt; Quit_Clicked(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;object&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt; sender, &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;ClickedEventArgs&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt; e)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;
&lt;p&gt;MessageBox&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;.Show(&amp;quot;Hello world&amp;quot;);&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;What is wrong ? &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;Thanks&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;</description></item></channel></rss>