{"id":58,"date":"2016-02-11T13:25:00","date_gmt":"2016-02-11T13:25:00","guid":{"rendered":"https:\/\/ibex.tech\/csharp\/?p=58"},"modified":"2022-02-17T06:24:15","modified_gmt":"2022-02-17T06:24:15","slug":"useful-things","status":"publish","type":"post","link":"https:\/\/ibex.tech\/csharp\/c-sharp\/application-control\/useful-things","title":{"rendered":".Useful Things"},"content":{"rendered":"<h4>Exiting The Application (i.e. File &gt; Exit menu item)<\/h4>\n<pre><code>\nApplication.Exit();\n<\/code><\/pre>\n<p>Note that the Form..::.Closed and Form..::.Closing events are not raised when the Application..::.Exit method is called to exit your application. If you have validation code in either of these events that must be executed, you should call the Form..::.Close method for each open form individually before calling the Exit method.<br \/>\nOr just use this instead:<\/p>\n<pre><code>\n\tthis.Close();\n<\/code><\/pre>\n<h4>Debug Mode Only Compiler Check<\/h4>\n<pre><code>\n#if DEBUG\t\t\t\/\/Only do if we're in debug mode\n#endif\n\n#if !DEBUG\t\t\t\/\/Only do if we're in release mode\n#endif\n\n#if (DEBUG &amp;&amp; DEBUG_AUTO_LOG_IN_USER_ID)\n#endif\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Exiting The Application (i.e. File &gt; Exit menu item) Application.Exit(); Note that the Form..::.Closed and Form..::.Closing events are not raised when the Application..::.Exit method is called to exit your application. If you have validation code in either of these events that must be executed, you should call the Form..::.Close method for each open form individually [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-58","post","type-post","status-publish","format-standard","hentry","category-application-control"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/58","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/comments?post=58"}],"version-history":[{"count":5,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/58\/revisions"}],"predecessor-version":[{"id":360,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/58\/revisions\/360"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/media?parent=58"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/categories?post=58"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/tags?post=58"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}