<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type='text/xsl' href='http://dineshpriyankara.spaces.live.com/mmm2008-05-17_13.22/rsspretty.aspx?rssquery=en-US;http%3a%2f%2fdineshpriyankara.spaces.live.com%2fcategory%2f__x1NET%2b2__x10%2bWindows%2ffeed.rss' version='1.0'?><rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:msn="http://schemas.microsoft.com/msn/spaces/2005/rss" xmlns:live="http://schemas.microsoft.com/live/spaces/2006/rss" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Dinesh's Blog             ::::::: Being Compiled :::::::: .NET 2.0 Windows</title><description /><link>http://dineshpriyankara.spaces.live.com/?_c11_BlogPart_BlogPart=blogview&amp;_c=BlogPart&amp;partqs=cat__x1NET%2b2__x10%2bWindows</link><language>en-US</language><pubDate>Thu, 26 Jun 2008 19:40:52 GMT</pubDate><lastBuildDate>Thu, 26 Jun 2008 19:40:52 GMT</lastBuildDate><generator>Microsoft Spaces v1.1</generator><docs>http://www.rssboard.org/rss-specification</docs><ttl>60</ttl><cf:parentRSS>http://dineshpriyankara.spaces.live.com/blog/feed.rss</cf:parentRSS><live:type>blogcategory</live:type><live:identity><live:id>4683496953178731031</live:id><live:alias>dineshpriyankara</live:alias></live:identity><cf:listinfo><cf:group ns="http://schemas.microsoft.com/live/spaces/2006/rss" element="typelabel" label="Type" /><cf:group ns="http://schemas.microsoft.com/live/spaces/2006/rss" element="tag" label="Tag" /><cf:group element="category" label="Category" /><cf:sort element="pubDate" label="Date" data-type="date" default="true" /><cf:sort element="title" label="Title" data-type="string" /><cf:sort ns="http://purl.org/rss/1.0/modules/slash/" element="comments" label="Comments" data-type="number" /></cf:listinfo><item><title>How your windows form was closed?</title><link>http://dineshpriyankara.spaces.live.com/Blog/cns!40FF1FAA28D7B217!238.entry</link><description>&lt;div&gt;&lt;font face="Verdana, Geneva, Arial, Sans-serif" size=1&gt;&lt;a href="http://www.dotnetforum.lk/2388.aspx"&gt;&lt;font color="#3366ff"&gt;&lt;strong&gt;This thread&lt;/strong&gt;&lt;/font&gt;&lt;/a&gt; at the dotnetforum regarding Form.Close() in 1.1 made me to search way-out designs in 2.0 for same. While digging out, I found a new property called &amp;quot;&lt;font color="#800000"&gt;&lt;strong&gt;CloseReason&lt;/strong&gt;&lt;/font&gt;&amp;quot; in FormClosedEventArgs that help us to see the cause of the &amp;quot;Closing&amp;quot;. This comes in handy when we want to validate the &amp;quot;&lt;strong&gt;&lt;em&gt;Closing&lt;/em&gt;&lt;/strong&gt;&amp;quot; of the form. &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font face=Verdana size=1&gt;&lt;/font&gt; &lt;/div&gt;
&lt;div&gt;&lt;font face="Verdana, Geneva, Arial, Sans-serif" size=1&gt;&lt;font color="#0000ff"&gt;private void&lt;/font&gt; Form1_FormClosing(&lt;font color="#0000ff"&gt;object &lt;/font&gt;sender, &lt;font color="#008080"&gt;FormClosingEventArgs &lt;/font&gt;e)&lt;br&gt;{&lt;br&gt;   &lt;font color="#0000ff"&gt;if &lt;/font&gt;(e.CloseReason != &lt;font color="#008080"&gt;CloseReason&lt;/font&gt;.ApplicationExitCall)&lt;br&gt;   {&lt;br&gt;      &lt;font color="#008080"&gt;MessageBox&lt;/font&gt;.Show(&lt;font color="#993300"&gt;&amp;quot;Un-Authorized call!&amp;quot;&lt;/font&gt;);&lt;br&gt;   }&lt;br&gt;}&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font face=Verdana size=1&gt;&lt;/font&gt; &lt;/div&gt;
&lt;div&gt;&lt;font face=Verdana size=1&gt;&lt;/font&gt; &lt;/div&gt;
&lt;div&gt;&lt;font face="Verdana, Geneva, Arial, Sans-serif" size=1&gt;At present, MSDN does not contain much information for this. Therefore the purpose-built is not clear but think it is for above typed scenario.&lt;/font&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=4683496953178731031&amp;page=RSS%3a+How+your+windows+form+was+closed%3f&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=dineshpriyankara.spaces.live.com&amp;amp;GT1=dineshpriyankara"&gt;</description><comments>http://dineshpriyankara.spaces.live.com/Blog/cns!40FF1FAA28D7B217!238.entry#comment</comments><guid isPermaLink="true">http://dineshpriyankara.spaces.live.com/Blog/cns!40FF1FAA28D7B217!238.entry</guid><pubDate>Fri, 01 Jul 2005 01:56:58 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://dineshpriyankara.spaces.live.com/blog/cns!40FF1FAA28D7B217!238/comments/feed.rss</wfw:commentRss><wfw:comment>http://dineshpriyankara.spaces.live.com/Blog/cns!40FF1FAA28D7B217!238.entry#comment</wfw:comment><dcterms:modified>2005-07-01T04:33:08Z</dcterms:modified></item></channel></rss>