Terminal.Gui.MessageBox.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. <!DOCTYPE html>
  2. <!--[if IE]><![endif]-->
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <title>Class MessageBox
  8. </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class MessageBox
  11. ">
  12. <meta name="generator" content="docfx 2.56.7.0">
  13. <link rel="shortcut icon" href="../../favicon.ico">
  14. <link rel="stylesheet" href="../../styles/docfx.vendor.css">
  15. <link rel="stylesheet" href="../../styles/docfx.css">
  16. <link rel="stylesheet" href="../../styles/main.css">
  17. <meta property="docfx:navrel" content="../../toc.html">
  18. <meta property="docfx:tocrel" content="toc.html">
  19. <meta property="docfx:rel" content="../../">
  20. </head>
  21. <body data-spy="scroll" data-target="#affix" data-offset="120">
  22. <div id="wrapper">
  23. <header>
  24. <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
  25. <div class="container">
  26. <div class="navbar-header">
  27. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
  28. <span class="sr-only">Toggle navigation</span>
  29. <span class="icon-bar"></span>
  30. <span class="icon-bar"></span>
  31. <span class="icon-bar"></span>
  32. </button>
  33. <a class="navbar-brand" href="../../index.html">
  34. <img id="logo" class="svg" src="../../images/logo48.png" alt="">
  35. </a>
  36. </div>
  37. <div class="collapse navbar-collapse" id="navbar">
  38. <form class="navbar-form navbar-right" role="search" id="search">
  39. <div class="form-group">
  40. <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
  41. </div>
  42. </form>
  43. </div>
  44. </div>
  45. </nav>
  46. <div class="subnav navbar navbar-default">
  47. <div class="container hide-when-search" id="breadcrumb">
  48. <ul class="breadcrumb">
  49. <li></li>
  50. </ul>
  51. </div>
  52. </div>
  53. </header>
  54. <div class="container body-content">
  55. <div id="search-results">
  56. <div class="search-list">Search Results for <span></span></div>
  57. <div class="sr-items">
  58. <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
  59. </div>
  60. <ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
  61. </div>
  62. </div>
  63. <div role="main" class="container body-content hide-when-search">
  64. <div class="sidenav hide-when-search">
  65. <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
  66. <div class="sidetoggle collapse" id="sidetoggle">
  67. <div id="sidetoc"></div>
  68. </div>
  69. </div>
  70. <div class="article row grid-right">
  71. <div class="col-md-10">
  72. <article class="content wrap" id="_content" data-uid="Terminal.Gui.MessageBox">
  73. <h1 id="Terminal_Gui_MessageBox" data-uid="Terminal.Gui.MessageBox" class="text-break">Class MessageBox
  74. </h1>
  75. <div class="markdown level0 summary">
  76. MessageBox displays a modal message to the user, with a title, a message and a series of options that the user can choose from.
  77. </div>
  78. <div class="markdown level0 conceptual"></div>
  79. <div class="inheritance">
  80. <h5>Inheritance</h5>
  81. <div class="level0"><span class="xref">System.Object</span></div>
  82. <div class="level1"><span class="xref">MessageBox</span></div>
  83. </div>
  84. <div class="inheritedMembers">
  85. <h5>Inherited Members</h5>
  86. <div>
  87. <span class="xref">System.Object.Equals(System.Object)</span>
  88. </div>
  89. <div>
  90. <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
  91. </div>
  92. <div>
  93. <span class="xref">System.Object.GetHashCode()</span>
  94. </div>
  95. <div>
  96. <span class="xref">System.Object.GetType()</span>
  97. </div>
  98. <div>
  99. <span class="xref">System.Object.MemberwiseClone()</span>
  100. </div>
  101. <div>
  102. <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
  103. </div>
  104. <div>
  105. <span class="xref">System.Object.ToString()</span>
  106. </div>
  107. </div>
  108. <h6><strong>Namespace</strong>: <a class="xref" href="Terminal.Gui.html">Terminal.Gui</a></h6>
  109. <h6><strong>Assembly</strong>: Terminal.Gui.dll</h6>
  110. <h5 id="Terminal_Gui_MessageBox_syntax">Syntax</h5>
  111. <div class="codewrapper">
  112. <pre><code class="lang-csharp hljs">public static class MessageBox</code></pre>
  113. </div>
  114. <h5 id="Terminal_Gui_MessageBox_examples"><strong>Examples</strong></h5>
  115. <pre><code>var n = MessageBox.Query (&quot;Quit Demo&quot;, &quot;Are you sure you want to quit this demo?&quot;, &quot;Yes&quot;, &quot;No&quot;);
  116. if (n == 0)
  117. quit = true;
  118. else
  119. quit = false;</code></pre>
  120. <h3 id="methods">Methods
  121. </h3>
  122. <a id="Terminal_Gui_MessageBox_ErrorQuery_" data-uid="Terminal.Gui.MessageBox.ErrorQuery*"></a>
  123. <h4 id="Terminal_Gui_MessageBox_ErrorQuery_NStack_ustring_NStack_ustring_NStack_ustring___" data-uid="Terminal.Gui.MessageBox.ErrorQuery(NStack.ustring,NStack.ustring,NStack.ustring[])">ErrorQuery(ustring, ustring, ustring[])</h4>
  124. <div class="markdown level1 summary">
  125. Presents an error <a class="xref" href="Terminal.Gui.MessageBox.html">MessageBox</a> with the specified title and message and a list of buttons to show to the user.
  126. </div>
  127. <div class="markdown level1 conceptual"></div>
  128. <h5 class="decalaration">Declaration</h5>
  129. <div class="codewrapper">
  130. <pre><code class="lang-csharp hljs">public static int ErrorQuery(ustring title, ustring message, params ustring[] buttons)</code></pre>
  131. </div>
  132. <h5 class="parameters">Parameters</h5>
  133. <table class="table table-bordered table-striped table-condensed">
  134. <thead>
  135. <tr>
  136. <th>Type</th>
  137. <th>Name</th>
  138. <th>Description</th>
  139. </tr>
  140. </thead>
  141. <tbody>
  142. <tr>
  143. <td><span class="xref">NStack.ustring</span></td>
  144. <td><span class="parametername">title</span></td>
  145. <td>Title for the query.</td>
  146. </tr>
  147. <tr>
  148. <td><span class="xref">NStack.ustring</span></td>
  149. <td><span class="parametername">message</span></td>
  150. <td>Message to display, might contain multiple lines.</td>
  151. </tr>
  152. <tr>
  153. <td><span class="xref">NStack.ustring</span>[]</td>
  154. <td><span class="parametername">buttons</span></td>
  155. <td>Array of buttons to add.</td>
  156. </tr>
  157. </tbody>
  158. </table>
  159. <h5 class="returns">Returns</h5>
  160. <table class="table table-bordered table-striped table-condensed">
  161. <thead>
  162. <tr>
  163. <th>Type</th>
  164. <th>Description</th>
  165. </tr>
  166. </thead>
  167. <tbody>
  168. <tr>
  169. <td><span class="xref">System.Int32</span></td>
  170. <td>The index of the selected button, or -1 if the user pressed ESC to close the dialog.</td>
  171. </tr>
  172. </tbody>
  173. </table>
  174. <h5 id="Terminal_Gui_MessageBox_ErrorQuery_NStack_ustring_NStack_ustring_NStack_ustring____remarks">Remarks</h5>
  175. <div class="markdown level1 remarks">
  176. The message box will be vertically and horizontally centered in the container and the size will be automatically determined
  177. from the size of the title, message. and buttons.
  178. </div>
  179. <a id="Terminal_Gui_MessageBox_ErrorQuery_" data-uid="Terminal.Gui.MessageBox.ErrorQuery*"></a>
  180. <h4 id="Terminal_Gui_MessageBox_ErrorQuery_System_Int32_System_Int32_NStack_ustring_NStack_ustring_NStack_ustring___" data-uid="Terminal.Gui.MessageBox.ErrorQuery(System.Int32,System.Int32,NStack.ustring,NStack.ustring,NStack.ustring[])">ErrorQuery(Int32, Int32, ustring, ustring, ustring[])</h4>
  181. <div class="markdown level1 summary">
  182. Presents an error <a class="xref" href="Terminal.Gui.MessageBox.html">MessageBox</a> with the specified title and message and a list of buttons to show to the user.
  183. </div>
  184. <div class="markdown level1 conceptual"></div>
  185. <h5 class="decalaration">Declaration</h5>
  186. <div class="codewrapper">
  187. <pre><code class="lang-csharp hljs">public static int ErrorQuery(int width, int height, ustring title, ustring message, params ustring[] buttons)</code></pre>
  188. </div>
  189. <h5 class="parameters">Parameters</h5>
  190. <table class="table table-bordered table-striped table-condensed">
  191. <thead>
  192. <tr>
  193. <th>Type</th>
  194. <th>Name</th>
  195. <th>Description</th>
  196. </tr>
  197. </thead>
  198. <tbody>
  199. <tr>
  200. <td><span class="xref">System.Int32</span></td>
  201. <td><span class="parametername">width</span></td>
  202. <td>Width for the window.</td>
  203. </tr>
  204. <tr>
  205. <td><span class="xref">System.Int32</span></td>
  206. <td><span class="parametername">height</span></td>
  207. <td>Height for the window.</td>
  208. </tr>
  209. <tr>
  210. <td><span class="xref">NStack.ustring</span></td>
  211. <td><span class="parametername">title</span></td>
  212. <td>Title for the query.</td>
  213. </tr>
  214. <tr>
  215. <td><span class="xref">NStack.ustring</span></td>
  216. <td><span class="parametername">message</span></td>
  217. <td>Message to display, might contain multiple lines.</td>
  218. </tr>
  219. <tr>
  220. <td><span class="xref">NStack.ustring</span>[]</td>
  221. <td><span class="parametername">buttons</span></td>
  222. <td>Array of buttons to add.</td>
  223. </tr>
  224. </tbody>
  225. </table>
  226. <h5 class="returns">Returns</h5>
  227. <table class="table table-bordered table-striped table-condensed">
  228. <thead>
  229. <tr>
  230. <th>Type</th>
  231. <th>Description</th>
  232. </tr>
  233. </thead>
  234. <tbody>
  235. <tr>
  236. <td><span class="xref">System.Int32</span></td>
  237. <td>The index of the selected button, or -1 if the user pressed ESC to close the dialog.</td>
  238. </tr>
  239. </tbody>
  240. </table>
  241. <h5 id="Terminal_Gui_MessageBox_ErrorQuery_System_Int32_System_Int32_NStack_ustring_NStack_ustring_NStack_ustring____remarks">Remarks</h5>
  242. <div class="markdown level1 remarks">
  243. Use <a class="xref" href="Terminal.Gui.MessageBox.html#Terminal_Gui_MessageBox_ErrorQuery_NStack_ustring_NStack_ustring_NStack_ustring___">ErrorQuery(ustring, ustring, ustring[])</a> instead; it automatically sizes the MessageBox based on the contents.
  244. </div>
  245. <a id="Terminal_Gui_MessageBox_Query_" data-uid="Terminal.Gui.MessageBox.Query*"></a>
  246. <h4 id="Terminal_Gui_MessageBox_Query_NStack_ustring_NStack_ustring_NStack_ustring___" data-uid="Terminal.Gui.MessageBox.Query(NStack.ustring,NStack.ustring,NStack.ustring[])">Query(ustring, ustring, ustring[])</h4>
  247. <div class="markdown level1 summary">
  248. Presents an error <a class="xref" href="Terminal.Gui.MessageBox.html">MessageBox</a> with the specified title and message and a list of buttons to show to the user.
  249. </div>
  250. <div class="markdown level1 conceptual"></div>
  251. <h5 class="decalaration">Declaration</h5>
  252. <div class="codewrapper">
  253. <pre><code class="lang-csharp hljs">public static int Query(ustring title, ustring message, params ustring[] buttons)</code></pre>
  254. </div>
  255. <h5 class="parameters">Parameters</h5>
  256. <table class="table table-bordered table-striped table-condensed">
  257. <thead>
  258. <tr>
  259. <th>Type</th>
  260. <th>Name</th>
  261. <th>Description</th>
  262. </tr>
  263. </thead>
  264. <tbody>
  265. <tr>
  266. <td><span class="xref">NStack.ustring</span></td>
  267. <td><span class="parametername">title</span></td>
  268. <td>Title for the query.</td>
  269. </tr>
  270. <tr>
  271. <td><span class="xref">NStack.ustring</span></td>
  272. <td><span class="parametername">message</span></td>
  273. <td>Message to display, might contain multiple lines.</td>
  274. </tr>
  275. <tr>
  276. <td><span class="xref">NStack.ustring</span>[]</td>
  277. <td><span class="parametername">buttons</span></td>
  278. <td>Array of buttons to add.</td>
  279. </tr>
  280. </tbody>
  281. </table>
  282. <h5 class="returns">Returns</h5>
  283. <table class="table table-bordered table-striped table-condensed">
  284. <thead>
  285. <tr>
  286. <th>Type</th>
  287. <th>Description</th>
  288. </tr>
  289. </thead>
  290. <tbody>
  291. <tr>
  292. <td><span class="xref">System.Int32</span></td>
  293. <td>The index of the selected button, or -1 if the user pressed ESC to close the dialog.</td>
  294. </tr>
  295. </tbody>
  296. </table>
  297. <h5 id="Terminal_Gui_MessageBox_Query_NStack_ustring_NStack_ustring_NStack_ustring____remarks">Remarks</h5>
  298. <div class="markdown level1 remarks">
  299. The message box will be vertically and horizontally centered in the container and the size will be automatically determined
  300. from the size of the message and buttons.
  301. </div>
  302. <a id="Terminal_Gui_MessageBox_Query_" data-uid="Terminal.Gui.MessageBox.Query*"></a>
  303. <h4 id="Terminal_Gui_MessageBox_Query_System_Int32_System_Int32_NStack_ustring_NStack_ustring_NStack_ustring___" data-uid="Terminal.Gui.MessageBox.Query(System.Int32,System.Int32,NStack.ustring,NStack.ustring,NStack.ustring[])">Query(Int32, Int32, ustring, ustring, ustring[])</h4>
  304. <div class="markdown level1 summary">
  305. Presents a normal <a class="xref" href="Terminal.Gui.MessageBox.html">MessageBox</a> with the specified title and message and a list of buttons to show to the user.
  306. </div>
  307. <div class="markdown level1 conceptual"></div>
  308. <h5 class="decalaration">Declaration</h5>
  309. <div class="codewrapper">
  310. <pre><code class="lang-csharp hljs">public static int Query(int width, int height, ustring title, ustring message, params ustring[] buttons)</code></pre>
  311. </div>
  312. <h5 class="parameters">Parameters</h5>
  313. <table class="table table-bordered table-striped table-condensed">
  314. <thead>
  315. <tr>
  316. <th>Type</th>
  317. <th>Name</th>
  318. <th>Description</th>
  319. </tr>
  320. </thead>
  321. <tbody>
  322. <tr>
  323. <td><span class="xref">System.Int32</span></td>
  324. <td><span class="parametername">width</span></td>
  325. <td>Width for the window.</td>
  326. </tr>
  327. <tr>
  328. <td><span class="xref">System.Int32</span></td>
  329. <td><span class="parametername">height</span></td>
  330. <td>Height for the window.</td>
  331. </tr>
  332. <tr>
  333. <td><span class="xref">NStack.ustring</span></td>
  334. <td><span class="parametername">title</span></td>
  335. <td>Title for the query.</td>
  336. </tr>
  337. <tr>
  338. <td><span class="xref">NStack.ustring</span></td>
  339. <td><span class="parametername">message</span></td>
  340. <td>Message to display, might contain multiple lines.</td>
  341. </tr>
  342. <tr>
  343. <td><span class="xref">NStack.ustring</span>[]</td>
  344. <td><span class="parametername">buttons</span></td>
  345. <td>Array of buttons to add.</td>
  346. </tr>
  347. </tbody>
  348. </table>
  349. <h5 class="returns">Returns</h5>
  350. <table class="table table-bordered table-striped table-condensed">
  351. <thead>
  352. <tr>
  353. <th>Type</th>
  354. <th>Description</th>
  355. </tr>
  356. </thead>
  357. <tbody>
  358. <tr>
  359. <td><span class="xref">System.Int32</span></td>
  360. <td>The index of the selected button, or -1 if the user pressed ESC to close the dialog.</td>
  361. </tr>
  362. </tbody>
  363. </table>
  364. <h5 id="Terminal_Gui_MessageBox_Query_System_Int32_System_Int32_NStack_ustring_NStack_ustring_NStack_ustring____remarks">Remarks</h5>
  365. <div class="markdown level1 remarks">
  366. Use <a class="xref" href="Terminal.Gui.MessageBox.html#Terminal_Gui_MessageBox_Query_NStack_ustring_NStack_ustring_NStack_ustring___">Query(ustring, ustring, ustring[])</a> instead; it automatically sizes the MessageBox based on the contents.
  367. </div>
  368. </article>
  369. </div>
  370. <div class="hidden-sm col-md-2" role="complementary">
  371. <div class="sideaffix">
  372. <div class="contribution">
  373. <ul class="nav">
  374. </ul>
  375. </div>
  376. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  377. <h5>In This Article</h5>
  378. <div></div>
  379. </nav>
  380. </div>
  381. </div>
  382. </div>
  383. </div>
  384. <footer>
  385. <div class="grad-bottom"></div>
  386. <div class="footer">
  387. <div class="container">
  388. <span class="pull-right">
  389. <a href="#top">Back to top</a>
  390. </span>
  391. <span>Generated by <strong>DocFX</strong></span>
  392. </div>
  393. </div>
  394. </footer>
  395. </div>
  396. <script type="text/javascript" src="../../styles/docfx.vendor.js"></script>
  397. <script type="text/javascript" src="../../styles/docfx.js"></script>
  398. <script type="text/javascript" src="../../styles/main.js"></script>
  399. </body>
  400. </html>