<?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>Browser Forms</title><link>https://www.infopathdev.com:443/forums/40.aspx</link><description>For browser form specific questions</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Closing infopath form either by code or custom Rules</title><link>https://www.infopathdev.com:443/forums/thread/72155.aspx</link><pubDate>Thu, 17 Nov 2011 17:06:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:72155</guid><dc:creator>bblanke</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/72155.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=72155</wfw:commentRss><description>I have noticed this only happens during events other than clicked_events and context_changed_event. Is there any way to call this during a changed_event, or is there a way to call the context_changed event or clicked_event through code?</description></item><item><title>Re: Closing infopath form either by code or custom Rules</title><link>https://www.infopathdev.com:443/forums/thread/60316.aspx</link><pubDate>Wed, 13 Oct 2010 20:49:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60316</guid><dc:creator>brian.jank</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60316.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=60316</wfw:commentRss><description>&lt;p&gt;this.Application.ActiveWindow.Close(); will close the window (as well as the form) where this.Application.Quit();&amp;nbsp; might have security issues, &lt;/p&gt;</description></item><item><title>Re: Closing infopath form either by code or custom Rules</title><link>https://www.infopathdev.com:443/forums/thread/60313.aspx</link><pubDate>Wed, 13 Oct 2010 20:29:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60313</guid><dc:creator>brian.jank</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60313.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=60313</wfw:commentRss><description>&lt;p&gt;somehow I wasn&amp;#39;t getting all the microsoft.office.infopath methods, re-added the reference and now I have what I need, thanks&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Closing infopath form either by code or custom Rules</title><link>https://www.infopathdev.com:443/forums/thread/60248.aspx</link><pubDate>Tue, 12 Oct 2010 21:25:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60248</guid><dc:creator>Potemkine</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60248.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=60248</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi Brian, you probably use C# or VB try &lt;/p&gt;&lt;p&gt;this.Close() or this.Application.Quit()&lt;/p&gt;&lt;p&gt;For VB replace &lt;b&gt;this &lt;/b&gt;for &lt;b&gt;me&lt;/b&gt;. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Closing infopath form either by code or custom Rules</title><link>https://www.infopathdev.com:443/forums/thread/60245.aspx</link><pubDate>Tue, 12 Oct 2010 18:53:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60245</guid><dc:creator>brian.jank</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60245.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=60245</wfw:commentRss><description>&lt;p&gt;that code didn&amp;#39;t work for me, maybe I&amp;#39;m missing a reference, using statement, or it isn&amp;#39;t meant to work in infopath 2010? &lt;/p&gt;
&lt;p&gt;I&amp;#39;ll keep looking and fiddling&lt;/p&gt;</description></item><item><title>Re: Closing infopath form either by code or custom Rules</title><link>https://www.infopathdev.com:443/forums/thread/60244.aspx</link><pubDate>Tue, 12 Oct 2010 18:47:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:60244</guid><dc:creator>brian.jank</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/60244.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=60244</wfw:commentRss><description>&lt;p&gt;what I did was set a field to a specific value at the end of the custom code&amp;nbsp;and have the &amp;quot;close form&amp;quot; rule trigger when that field is set to the specific value. the problem then is the rule isn&amp;#39;t checked when the field is set so the button has to be clicked twice before the form closes. It&amp;#39;s a squirly work around and I&amp;#39;m going to try the programmatic solutions in this thread ina&amp;nbsp; sec but in case it&amp;#39;s more along the lines of what you&amp;#39;re trying to do it&amp;#39;s another option for you :)&lt;/p&gt;</description></item><item><title>Re: Closing infopath form either by code or custom Rules</title><link>https://www.infopathdev.com:443/forums/thread/33397.aspx</link><pubDate>Thu, 23 Oct 2008 06:40:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33397</guid><dc:creator>sandhyapati</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33397.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=33397</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;you can use the following code for closing the form&lt;/p&gt;
&lt;p&gt;XDocument.View.Window.Close(true); &lt;/p&gt;
&lt;p&gt;if you want to close the whole InfoPath application you can use &lt;/p&gt;
&lt;p&gt;Application.ActiveWindow.Close();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Closing infopath form either by code or custom Rules</title><link>https://www.infopathdev.com:443/forums/thread/33380.aspx</link><pubDate>Wed, 22 Oct 2008 15:49:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33380</guid><dc:creator>Bhavesh</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33380.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=33380</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;When you have some code behind on the button click along with the rule for closing the form, rule will be executed before the code behind, so what you can do is remove the rule for closing the form from the button. Let the form execute the code behind logic then create a new blank view and switch the view programatically to a new blank view with one button for &amp;quot;close form&amp;quot;. add rule for closing the form on this new view.&lt;/p&gt;
&lt;p&gt;For switching view programatically you can add &lt;font color="#0000ff"&gt;this&lt;/font&gt;.ViewInfos.SwitchView(viewname); after your code.&lt;/p&gt;
&lt;p&gt;Hope this will help you.&lt;/p&gt;
&lt;p&gt;Bhavesh&lt;/p&gt;</description></item><item><title>Re: Closing infopath form either by code or custom Rules</title><link>https://www.infopathdev.com:443/forums/thread/33237.aspx</link><pubDate>Sat, 18 Oct 2008 05:19:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33237</guid><dc:creator>swathip</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33237.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=33237</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;you can use the following code line to close the form.&lt;/p&gt;&lt;font size="2"&gt;&lt;span style="FONT-SIZE:10pt;COLOR:black;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-themecolor:text1;mso-no-proof:yes;"&gt;thisXDocument.View.Window.Close(true);&lt;/span&gt;&lt;span style="COLOR:black;mso-themecolor:text1;"&gt;&lt;/span&gt;&lt;/font&gt; 
&lt;p&gt;&lt;font size="2"&gt;hope this will help to you.&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Closing infopath form either by code or custom Rules</title><link>https://www.infopathdev.com:443/forums/thread/33219.aspx</link><pubDate>Fri, 17 Oct 2008 18:15:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33219</guid><dc:creator>srivoleti_95</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33219.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=33219</wfw:commentRss><description>&lt;p&gt;Hi All,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I have a infopath 2007 form where I am trying to close the form programatically in C#. I was using this.Submit() to close the form on click of a button. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;Now I have changed all the connections to the UDC Library and this function to close the form stopped working. Although there is no relation to the this.Submit() and the UDC Library, it is the only change that I have done.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I can use the Rule to close the form, but it is closing the form before the code behind code is getting called, which inturn is calling an event handler. &lt;/p&gt;
&lt;p&gt;Alteast is there a way we could ensure that all data is properly passed to the event handler before the form is getting closed?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Can anyone throw some light on what could be done to rectify this issue? &lt;/p&gt;
&lt;p&gt;Thanks a lot in advance :) &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards Sridhar &lt;/p&gt;</description></item></channel></rss>