{"id":114,"date":"2010-03-17T20:26:20","date_gmt":"2010-03-17T20:26:20","guid":{"rendered":"https:\/\/ibex.tech\/visualcpp\/?p=114"},"modified":"2022-02-17T06:24:05","modified_gmt":"2022-02-17T06:24:05","slug":"using-message-boxes","status":"publish","type":"post","link":"https:\/\/ibex.tech\/visualcpp\/message-box\/using-message-boxes","title":{"rendered":"Using Message Boxes"},"content":{"rendered":"<h4>\nTypical Info Message Box<br \/>\n<\/h4>\n<pre>\r\n<code>\r\n\tMessageBox::Show(L&quot;Message Text&quot;, L&quot;Message Box Title&quot;, MessageBoxButtons::OK, MessageBoxIcon::Information);\r\n<\/code><\/pre>\n<h4>\nTypical Error Message Box<br \/>\n<\/h4>\n<pre>\r\n<code>\r\n\/\/1st string is message, 2nd string is box title.  Here&#39;s a classic error message usage:\r\ncatch (Exception^ e)\r\n{\r\n\tMessageBox::Show(L&quot;Comms Failed with the following error:\\n&quot; + e, L&quot;Error&quot;, MessageBoxButtons::OK, MessageBoxIcon::Error);\r\n}\r\n<\/code><\/pre>\n<h4>\nExclamation Error Box<br \/>\n<\/h4>\n<pre>\r\n<code>\r\nMessageBox::Show(L&quot;You can&#39;t do this&quot;, L&quot;Not Possible&quot;, MessageBoxButtons::OK, MessageBoxIcon::Asterisk);\r\n<\/code><\/pre>\n<h4>\nSelect OK To Continue Message Box<br \/>\n<\/h4>\n<pre>\r\n<code>\r\nif (\r\n\tMessageBox::Show(\r\n\t\t\t\tL&quot;Are you sure you want to do this?&quot;,\r\n\t\t\t\tL&quot;Continue?&quot;,\r\n\t\t\t\tMessageBoxButtons::YesNo,\r\n\t\t\t\tMessageBoxIcon::Exclamation\r\n\t\t\t\t) == System::Windows::Forms::DialogResult::Yes)\r\n{\r\n<\/code><\/pre>\n<h4>\nMessage Box &#8211; Dealing With Multiple Options<br \/>\n<\/h4>\n<pre>\r\n<code>\r\n\tSystem::Windows::Forms::DialogResult Result;\r\n\tResult = MessageBox::Show(\r\n\t\t\t\t\tL&quot;Would you like to save changes to the current settings and layout?&quot;,\r\n\t\t\t\t\tL&quot;Save Changes?&quot;,\r\n\t\t\t\t\tMessageBoxButtons::YesNoCancel,\r\n\t\t\t\t\tMessageBoxIcon::Exclamation);\r\n\tif (Result == System::Windows::Forms::DialogResult::Cancel)\r\n\t{\r\n\t\treturn(false);\r\n\t}\r\n\telse if (Result == System::Windows::Forms::DialogResult::Yes)\r\n\t{\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Typical Info Message Box MessageBox::Show(L&quot;Message Text&quot;, L&quot;Message Box Title&quot;, MessageBoxButtons::OK, MessageBoxIcon::Information); Typical Error Message Box \/\/1st string is message, 2nd string is box title. Here&#39;s a classic error message usage: catch (Exception^ e) { MessageBox::Show(L&quot;Comms Failed with the following error:\\n&quot; + e, L&quot;Error&quot;, MessageBoxButtons::OK, MessageBoxIcon::Error); } Exclamation Error Box MessageBox::Show(L&quot;You can&#39;t do this&quot;, L&quot;Not Possible&quot;, [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-114","post","type-post","status-publish","format-standard","hentry","category-message-box"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/114","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=114"}],"version-history":[{"count":4,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/114\/revisions"}],"predecessor-version":[{"id":1412,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/114\/revisions\/1412"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/media?parent=114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/categories?post=114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/tags?post=114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}