{"id":315,"date":"2010-07-08T13:07:18","date_gmt":"2010-07-08T13:07:18","guid":{"rendered":"https:\/\/ibex.tech\/visualcpp\/?p=315"},"modified":"2022-02-17T06:24:05","modified_gmt":"2022-02-17T06:24:05","slug":"storing-form-location","status":"publish","type":"post","link":"https:\/\/ibex.tech\/visualcpp\/forms\/form-size-location\/storing-form-location","title":{"rendered":"Storing Form Location"},"content":{"rendered":"<h5>Variables<\/h5>\n<pre><code>\r\n\tprivate: int PositionTopLast;\r\n\tprivate: int PositionLeftLast;\r\n<\/code><\/pre>\n<h5>In the forms Constructor<\/h5>\n<pre><code>\r\n\tPositionTopLast = 0x7fffffff;\r\n\tPositionLeftLast = 0x7fffffff;\r\n<\/code><\/pre>\n<h5>Form Load<\/h5>\n<pre><code>\r\n\t\/\/SET FORM TO LAST LOCATION\r\n\ttry\r\n\t{\r\n\t\tif (PositionTopLast != 0x7fffffff)\r\n\t\t{\r\n\t\t\tthis-&gt;Top = PositionTopLast;\r\n\t\t\tthis-&gt;Left = PositionLeftLast;\r\n\t\t}\r\n\t}\r\n\tcatch (Exception ^)\r\n\t{\r\n\t}\r\n<\/code><\/pre>\n<h5>Form Position Changed<\/h5>\n<pre><code>\r\n\tprivate: System::Void frmMyForm_ResizeEnd(System::Object^  sender, System::EventArgs^  e)\r\n\t{\r\n\t\tif ((this-&gt;Top != PositionTopLast) || (this-&gt;Left != PositionLeftLast))\r\n\t\t{\r\n\t\t\tPositionTopLast = this-&gt;Top;\r\n\t\t\tPositionLeftLast = this-&gt;Left;\r\n\t\t}\r\n\t}\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Variables private: int PositionTopLast; private: int PositionLeftLast; In the forms Constructor PositionTopLast = 0x7fffffff; PositionLeftLast = 0x7fffffff; Form Load \/\/SET FORM TO LAST LOCATION try { if (PositionTopLast != 0x7fffffff) { this-&gt;Top = PositionTopLast; this-&gt;Left = PositionLeftLast; } } catch (Exception ^) { } Form Position Changed private: System::Void frmMyForm_ResizeEnd(System::Object^ sender, System::EventArgs^ e) { if [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40],"tags":[],"class_list":["post-315","post","type-post","status-publish","format-standard","hentry","category-form-size-location"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/comments?post=315"}],"version-history":[{"count":2,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/315\/revisions"}],"predecessor-version":[{"id":1102,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/315\/revisions\/1102"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/media?parent=315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/categories?post=315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/tags?post=315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}