Powershell messagebox system windows forms

Содержание
  1. Message Box Класс
  2. Определение
  3. Примеры
  4. Комментарии
  5. Методы
  6. Message Box. Show Method
  7. Definition
  8. Overloads
  9. Show(String)
  10. Parameters
  11. Returns
  12. Examples
  13. Remarks
  14. Applies to
  15. Show(IWin32Window, String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, String, String)
  16. Parameters
  17. Returns
  18. Exceptions
  19. Examples
  20. Remarks
  21. See also
  22. Applies to
  23. Show(String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, String, HelpNavigator, Object)
  24. Parameters
  25. Returns
  26. Exceptions
  27. Examples
  28. Remarks
  29. See also
  30. Applies to
  31. Show(IWin32Window, String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, String)
  32. Parameters
  33. Returns
  34. Exceptions
  35. Examples
  36. Remarks
  37. See also
  38. Applies to
  39. Show(String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, String, HelpNavigator)
  40. Parameters
  41. Returns
  42. Exceptions
  43. Examples
  44. Remarks
  45. See also
  46. Applies to
  47. Show(String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, String, String)
  48. Parameters
  49. Returns
  50. Exceptions
  51. Examples
  52. Remarks
  53. See also
  54. Applies to
  55. Show(IWin32Window, String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions)
  56. Parameters
  57. Returns
  58. Exceptions
  59. Examples
  60. Remarks
  61. See also
  62. Applies to
  63. Show(String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, String)
  64. Parameters
  65. Returns
  66. Exceptions
  67. Examples
  68. Remarks
  69. See also
  70. Applies to
  71. Show(String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, Boolean)
  72. Parameters
  73. Returns
  74. Exceptions
  75. Examples
  76. Remarks
  77. See also
  78. Applies to
  79. Show(IWin32Window, String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, String, HelpNavigator)
  80. Parameters
  81. Returns
  82. Exceptions
  83. Examples
  84. Remarks
  85. See also
  86. Applies to
  87. Show(IWin32Window, String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton)
  88. Parameters
  89. Returns
  90. Exceptions
  91. Examples
  92. Remarks
  93. See also
  94. Applies to
  95. Show(IWin32Window, String, String, MessageBoxButtons, MessageBoxIcon)
  96. Parameters
  97. Returns
  98. Exceptions
  99. Examples
  100. Remarks
  101. See also
  102. Applies to
  103. Show(String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton)
  104. Parameters
  105. Returns
  106. Exceptions
  107. Examples
  108. Remarks
  109. See also
  110. Applies to
  111. Show(IWin32Window, String, String, MessageBoxButtons)
  112. Parameters
  113. Returns
  114. Exceptions
  115. Examples
  116. Remarks
  117. See also
  118. Applies to
  119. Show(String, String, MessageBoxButtons, MessageBoxIcon)
  120. Parameters
  121. Returns
  122. Exceptions
  123. Examples
  124. Remarks
  125. See also
  126. Applies to
  127. Show(IWin32Window, String, String)
  128. Parameters
  129. Returns
  130. Remarks
  131. Applies to
  132. Show(String, String, MessageBoxButtons)
  133. Parameters
  134. Returns
  135. Exceptions
  136. Examples
  137. Remarks
  138. See also
  139. Applies to
  140. Show(IWin32Window, String)
  141. Parameters
  142. Returns
  143. Remarks
  144. Applies to
  145. Show(String, String)
  146. Parameters
  147. Returns
  148. Remarks
  149. Applies to
  150. Show(String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions)
  151. Parameters
  152. Returns
  153. Exceptions
  154. Examples
  155. Remarks
  156. See also
  157. Applies to
  158. Show(IWin32Window, String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, String, HelpNavigator, Object)
  159. Parameters
  160. Returns
  161. Exceptions
  162. Examples
  163. Remarks

Message Box Класс

Определение

Отображает окно сообщения (диалоговое окно) с текстом для пользователя. Displays a message window, also known as a dialog box, which presents a message to the user. Это модальное окно, блокирующее другие действия в приложении, пока пользователь не закроет его. It is a modal window, blocking other actions in the application until the user closes it. MessageBox может содержать текст, кнопки и символы для отображения пользователю информации и инструкций. A MessageBox can contain text, buttons, and symbols that inform and instruct the user.

Примеры

В следующем примере кода показано, как использовать объект MessageBox для информирования пользователя об отсутствующей записи в TextBox . The following code example shows how to use a MessageBox to inform the user of a missing entry in a TextBox. Для этого примера требуется, чтобы метод вызывался из существующей формы с TextBox именем ServerName . This example requires that the method is called from an existing form with a TextBox named ServerName on it.

В следующем примере кода показано, как задать пользователю да или нет вопроса и принять решение, основанное на ответе. The following code example shows how to ask the user a yes or no question and make a decision based on the response.

Комментарии

Нельзя создать новый экземпляр MessageBox класса. You cannot create a new instance of the MessageBox class. Чтобы отобразить окно сообщения, вызовите static метод MessageBox.Show . To display a message box, call the static method MessageBox.Show. Заголовок, сообщение, кнопки и значки, отображаемые в окне сообщения, определяются параметрами, передаваемыми этому методу. The title, message, buttons, and icons displayed in the message box are determined by parameters that you pass to this method.

Методы

Определяет, равен ли указанный объект текущему объекту. Determines whether the specified object is equal to the current object.

(Унаследовано от Object) GetHashCode()

Служит хэш-функцией по умолчанию. Serves as the default hash function.

(Унаследовано от Object) GetType()

Возвращает объект Type для текущего экземпляра. Gets the Type of the current instance.

(Унаследовано от Object) MemberwiseClone()

Создает неполную копию текущего объекта Object. Creates a shallow copy of the current Object.

(Унаследовано от Object) Show(IWin32Window, String)

Отображает перед заданным объектом окно сообщения, содержащее заданный текст. Displays a message box in front of the specified object and with the specified text.

Отображает перед заданным объектом окно сообщения, содержащее заданный текст и заголовок. Displays a message box in front of the specified object and with the specified text and caption.

Отображает перед заданным объектом окно сообщения, содержащее заданный текст, заголовок и кнопки. Displays a message box in front of the specified object and with the specified text, caption, and buttons.

Отображает перед заданным объектом окно сообщения, содержащее заданный текст, заголовок, кнопки и значок. Displays a message box in front of the specified object and with the specified text, caption, buttons, and icon.

Отображает перед заданным объектом окно сообщения, содержащее заданный текст, заголовок, кнопки, значок и кнопку по умолчанию. Displays a message box in front of the specified object and with the specified text, caption, buttons, icon, and default button.

Отображает перед заданным объектом окно сообщения, содержащее заданный текст, заголовок, кнопки, значок, кнопку по умолчанию и параметры. Displays a message box in front of the specified object and with the specified text, caption, buttons, icon, default button, and options.

Отображает окно сообщения с заданным текстом, заголовком, кнопками, значком, кнопкой по умолчанию, параметрами для выбора, кнопкой «Справка», используя заданный файл справки. Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file.

Отображает окно сообщения с заданным текстом, заголовком, кнопками, значком, кнопкой по умолчанию, параметрами для выбора, кнопкой «Справка», используя заданный файл справки и HelpNavigator . Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file and HelpNavigator .

Отображает окно сообщения с заданным текстом, заголовком, кнопками, значком, кнопкой по умолчанию, параметрами для выбора, кнопкой «Справка», используя заданный файл справки, HelpNavigator и раздел справки. Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file, HelpNavigator , and Help topic.

Отображает окно сообщения с заданным текстом, заголовком, кнопками, значком, кнопкой по умолчанию, параметрами для выбора, кнопкой «Справка», используя заданный файл справки и Ключевое слово справки. Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file and Help keyword.

Отображает окно сообщения с заданным текстом. Displays a message box with specified text.

Отображает окно сообщения с заданным текстом и заголовком. Displays a message box with specified text and caption.

Отображает окно сообщения с заданным текстом, заголовком и кнопками. Displays a message box with specified text, caption, and buttons.

Отображает окно сообщения с заданным текстом, заголовком, кнопками и значком. Displays a message box with specified text, caption, buttons, and icon.

Отображает окно сообщения с заданным текстом, заголовком, кнопками, значком и кнопкой по умолчанию. Displays a message box with the specified text, caption, buttons, icon, and default button.

Отображает окно сообщения с заданным текстом, заголовком, кнопками, значком, кнопкой по умолчанию и параметрами для выбора. Displays a message box with the specified text, caption, buttons, icon, default button, and options.

Отображает окно сообщения с заданным текстом, заголовком, кнопками, значком, кнопкой по умолчанию, параметрами для выбора и кнопкой «Справка». Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button.

Отображает окно сообщения с заданным текстом, заголовком, кнопками, значком, кнопкой по умолчанию, параметрами для выбора, кнопкой «Справка», используя заданный файл справки. Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file.

Отображает окно сообщения с заданным текстом, заголовком, кнопками, значком, кнопкой по умолчанию, параметрами для выбора, кнопкой «Справка», используя заданный файл справки и HelpNavigator . Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file and HelpNavigator .

Отображает окно сообщения с заданным текстом, заголовком, кнопками, значком, кнопкой по умолчанию, параметрами для выбора, кнопкой «Справка», используя заданный файл справки, HelpNavigator и раздел справки. Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file, HelpNavigator , and Help topic.

Отображает окно сообщения с заданным текстом, заголовком, кнопками, значком, кнопкой по умолчанию, параметрами для выбора, кнопкой «Справка», используя заданный файл справки и Ключевое слово справки. Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file and Help keyword.

Возвращает строку, представляющую текущий объект. Returns a string that represents the current object.

Message Box. Show Method

Definition

Displays a message box.

Overloads

Displays a message box with specified text.

Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file and Help keyword.

Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file, HelpNavigator , and Help topic.

Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file.

Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file and HelpNavigator .

Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file and Help keyword.

Displays a message box in front of the specified object and with the specified text, caption, buttons, icon, default button, and options.

Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file.

Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button.

Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file and HelpNavigator .

Displays a message box in front of the specified object and with the specified text, caption, buttons, icon, and default button.

Displays a message box in front of the specified object and with the specified text, caption, buttons, and icon.

Displays a message box with the specified text, caption, buttons, icon, and default button.

Displays a message box in front of the specified object and with the specified text, caption, and buttons.

Displays a message box with specified text, caption, buttons, and icon.

Displays a message box in front of the specified object and with the specified text and caption.

Displays a message box with specified text, caption, and buttons.

Displays a message box in front of the specified object and with the specified text.

Displays a message box with specified text and caption.

Displays a message box with the specified text, caption, buttons, icon, default button, and options.

Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file, HelpNavigator , and Help topic.

Show(String)

Displays a message box with specified text.

Parameters

The text to display in the message box.

Returns

One of the DialogResult values.

Examples

The following code example displays a simple message box.

Remarks

By default, the message box displays an OK button. The message box does not contain a caption in the title.

Applies to

Show(IWin32Window, String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, String, String)

Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file and Help keyword.

Parameters

An implementation of IWin32Window that will own the modal dialog box.

The text to display in the message box.

The text to display in the title bar of the message box.

One of the MessageBoxButtons values that specifies which buttons to display in the message box.

One of the MessageBoxIcon values that specifies which icon to display in the message box.

One of the MessageBoxDefaultButton values that specifies the default button for the message box.

One of the MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.

Читайте также:  Asus p5sd2 vm драйвера windows 10

The path and name of the Help file to display when the user clicks the Help button.

The Help keyword to display when the user clicks the Help button.

Returns

One of the DialogResult values.

Exceptions

buttons is not a member of MessageBoxButtons.

icon is not a member of MessageBoxIcon.

The defaultButton specified is not a member of MessageBoxDefaultButton.

An attempt was made to display the MessageBox in a process that is not running in User Interactive mode. This is specified by the UserInteractive property.

buttons specified an invalid combination of MessageBoxButtons.

Examples

The following code example demonstrates how to show a message box parented to the main window. The message box displays a Help button. When the user clicks the Help button, the Mspaint.chm Help file is opened and the topic identified by the mspaint.chm::/paint_brush.htm keyword is displayed. The example requires that the Mspaint.chm Help file is installed.

Remarks

A message box is a modal dialog box, which means no input (keyboard or mouse click) can occur except to objects on the modal form. The program must hide or close a modal form (typically in response to some user action) before input to another form can occur. You can use the owner parameter to specify a particular object, which implements the IWin32Window interface, that will serve as the dialog box’s top-level owner.

When the user clicks the Help button, the Help file specified in the helpFilePath parameter is opened and the Help keyword topic identified by the keyword parameter is displayed. The form that owns the message box (or the active form) also receives the HelpRequested event.

See also

Applies to

Show(String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, String, HelpNavigator, Object)

Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file, HelpNavigator , and Help topic.

Parameters

The text to display in the message box.

The text to display in the title bar of the message box.

One of the MessageBoxButtons values that specifies which buttons to display in the message box.

One of the MessageBoxIcon values that specifies which icon to display in the message box.

One of the MessageBoxDefaultButton values that specifies the default button for the message box.

One of the MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.

The path and name of the Help file to display when the user clicks the Help button.

One of the HelpNavigator values.

The numeric ID of the Help topic to display when the user clicks the Help button.

Returns

One of the DialogResult values.

Exceptions

buttons is not a member of MessageBoxButtons.

icon is not a member of MessageBoxIcon.

The defaultButton specified is not a member of MessageBoxDefaultButton.

An attempt was made to display the MessageBox in a process that is not running in User Interactive mode. This is specified by the UserInteractive property.

buttons specified an invalid combination of MessageBoxButtons.

Examples

The following code example demonstrates how to show a message box with a Help button. When the user clicks the Help button, the Mspaint.chm Help file is opened and the Help index tab and the topic identified by the ovals keyword are displayed. The example requires that the Mspaint.chm Help file is installed.

Remarks

A message box is a modal dialog box, which means no input (keyboard or mouse click) can occur except to objects on the modal form. The program must hide or close a modal form (typically in response to some user action) before input to another form can occur.

When the user clicks the Help button, the Help file specified in the helpFilePath parameter is opened and the Help content identified by the navigator parameter is displayed. The form that owns the message box (or the active form) also receives the HelpRequested event.

Compiled help files provide table of contents, index, search, and keyword links in pages. You can use the following values for navigator : TableOfContents, Find, Index, or Topic.

You can use param to provide further refinement of the Topic command. If the value specified in the navigator parameter is TableOfContents, Index, or Find, this value should be null . If the navigator parameter references Topic, this value should reference an object that contains the numeric value of the topic to display.

The helpFilePath parameter can be of the form C:\path\sample.chm or /folder/file.htm.

See also

Applies to

Show(IWin32Window, String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, String)

Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file.

Parameters

An implementation of IWin32Window that will own the modal dialog box.

The text to display in the message box.

The text to display in the title bar of the message box.

One of the MessageBoxButtons values that specifies which buttons to display in the message box.

One of the MessageBoxIcon values that specifies which icon to display in the message box.

One of the MessageBoxDefaultButton values that specifies the default button for the message box.

One of the MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.

The path and name of the Help file to display when the user clicks the Help button.

Returns

One of the DialogResult values.

Exceptions

buttons is not a member of MessageBoxButtons.

icon is not a member of MessageBoxIcon.

The defaultButton specified is not a member of MessageBoxDefaultButton.

An attempt was made to display the MessageBox in a process that is not running in User Interactive mode. This is specified by the UserInteractive property.

buttons specified an invalid combination of MessageBoxButtons.

Examples

The following code example demonstrates how to show a message box that parented to the main form. The message box displays a Help button. When the user clicks the Help button, the Mspaint.chm Help file is opened. The example requires that the Mspaint.chm Help file is installed.

Remarks

A message box is a modal dialog box, which means no input (keyboard or mouse click) can occur except to objects on the modal form. The program must hide or close a modal form (typically in response to some user action) before input to another form can occur. You can use the owner parameter to specify a particular object, which implements the IWin32Window interface, that will serve as the dialog box’s top-level window and owner.

When the user clicks the Help button, the Help file specified in the helpFilePath parameter is opened. The form that owns the message box (or the active form) also receives the HelpRequested event.

The helpFilePath parameter can be of the form C:\path\sample.chm or /folder/file.htm.

See also

Applies to

Show(String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, String, HelpNavigator)

Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file and HelpNavigator .

Parameters

The text to display in the message box.

The text to display in the title bar of the message box.

One of the MessageBoxButtons values that specifies which buttons to display in the message box.

One of the MessageBoxIcon values that specifies which icon to display in the message box.

One of the MessageBoxDefaultButton values that specifies the default button for the message box.

One of the MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.

The path and name of the Help file to display when the user clicks the Help button.

One of the HelpNavigator values.

Returns

One of the DialogResult values.

Exceptions

buttons is not a member of MessageBoxButtons.

icon is not a member of MessageBoxIcon.

The defaultButton specified is not a member of MessageBoxDefaultButton.

An attempt was made to display the MessageBox in a process that is not running in User Interactive mode. This is specified by the UserInteractive property.

buttons specified an invalid combination of MessageBoxButtons.

Examples

The following code example demonstrates how to show a message box with a Help button. When the user clicks the Help button, the Mspaint.chm Help file is opened and the Help index tab is displayed. The example requires that the Mspaint.chm Help file is installed.

Remarks

A message box is a modal dialog box, which means no input (keyboard or mouse click) can occur except to objects on the modal form. The program must hide or close a modal form (typically in response to some user action) before input to another form can occur.

When the user clicks the Help button, the help file specified in the helpFilePath parameter is opened and the Help content identified by the navigator parameter is displayed. The form that owns the message box (or the active form) also receives the HelpRequested event.

Compiled Help files provide table of contents, index, search, and keyword links in pages. You can use the following values for navigator : TableOfContents, Find, Index, or Topic.

The helpFilePath parameter can be of the form C:\path\sample.chm or /folder/file.htm.

See also

Applies to

Show(String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, String, String)

Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file and Help keyword.

Parameters

The text to display in the message box.

The text to display in the title bar of the message box.

One of the MessageBoxButtons values that specifies which buttons to display in the message box.

One of the MessageBoxIcon values that specifies which icon to display in the message box.

One of the MessageBoxDefaultButton values that specifies the default button for the message box.

One of the MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.

The path and name of the Help file to display when the user clicks the Help button.

The Help keyword to display when the user clicks the Help button.

Returns

One of the DialogResult values.

Exceptions

buttons is not a member of MessageBoxButtons.

icon is not a member of MessageBoxIcon.

The defaultButton specified is not a member of MessageBoxDefaultButton.

An attempt was made to display the MessageBox in a process that is not running in User Interactive mode. This is specified by the UserInteractive property.

buttons specified an invalid combination of MessageBoxButtons.

Examples

The following code example demonstrates how to show a message box with a Help button. When the user clicks the Help button, the Mspaint.chm Help file is opened and the topic identified by the mspaint.chm::/paint_brush.htm keyword is displayed. The example requires that the Mspaint.chm Help file is installed.

Remarks

A message box is a modal dialog box, which means no input (keyboard or mouse click) can occur except to objects on the modal form. The program must hide or close a modal form (typically in response to some user action) before input to another form can occur.

When the user clicks the Help button, the Help file specified in the helpFilePath parameter is opened and the Help keyword topic identified by the keyword parameter is displayed. The form that owns the message box (or the active form) also receives the HelpRequested event.

See also

Applies to

Show(IWin32Window, String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions)

Displays a message box in front of the specified object and with the specified text, caption, buttons, icon, default button, and options.

Parameters

An implementation of IWin32Window that will own the modal dialog box.

The text to display in the message box.

Читайте также:  Windows repack by diakov

The text to display in the title bar of the message box.

One of the MessageBoxButtons values that specifies which buttons to display in the message box.

One of the MessageBoxIcon values that specifies which icon to display in the message box.

One of the MessageBoxDefaultButton values the specifies the default button for the message box.

One of the MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.

Returns

One of the DialogResult values.

Exceptions

buttons is not a member of MessageBoxButtons.

icon is not a member of MessageBoxIcon.

defaultButton is not a member of MessageBoxDefaultButton.

An attempt was made to display the MessageBox in a process that is not running in User Interactive mode. This is specified by the UserInteractive property.

options specified DefaultDesktopOnly or ServiceNotification and specified a value in the owner parameter. These two options should be used only if you invoke the version of this method that does not take an owner parameter.

buttons specified an invalid combination of MessageBoxButtons.

Examples

The following code example demonstrates how to display a MessageBox with the options supported by this overload of Show. After verifying that a string variable, ServerName , is empty, the example displays a MessageBox, offering the user the option to cancel the operation. If the Show method’s return value evaluates to Yes, the form that displayed the MessageBox is closed.

Remarks

You can use the owner parameter to specify a particular object, which implements the IWin32Window interface, that will serve as the dialog box’s top-level window and owner. A message box is a modal dialog box, which means no input (keyboard or mouse click) can occur except to objects on the modal form. The program must hide or close a modal form (typically in response to some user action) before input to another form can occur.

You can have a maximum of three buttons on the message box.

See also

Applies to

Show(String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, String)

Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file.

Parameters

The text to display in the message box.

The text to display in the title bar of the message box.

One of the MessageBoxButtons values that specifies which buttons to display in the message box.

One of the MessageBoxIcon values that specifies which icon to display in the message box.

One of the MessageBoxDefaultButton values that specifies the default button for the message box.

One of the MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.

The path and name of the Help file to display when the user clicks the Help button.

Returns

One of the DialogResult values.

Exceptions

buttons is not a member of MessageBoxButtons.

icon is not a member of MessageBoxIcon.

The defaultButton specified is not a member of MessageBoxDefaultButton.

An attempt was made to display the MessageBox in a process that is not running in User Interactive mode. This is specified by the UserInteractive property.

buttons specified an invalid combination of MessageBoxButtons.

Examples

The following code example demonstrates how to show a message box with a Help button. When the user clicks the Help button, the Mspaint.chm Help file is opened. The example requires that the Mspaint.chm Help file is installed.

Remarks

A message box is a modal dialog box, which means no input (keyboard or mouse click) can occur except to objects on the modal form. The program must hide or close a modal form (typically in response to some user action) before input to another form can occur.

When the user clicks Help button, the Help file specified in the helpFilePath parameter is opened. The form that owns the message box (or the active form) also receives the HelpRequested event.

The helpFilePath parameter can be of the form C:\path\sample.chm or /folder/file.htm.

See also

Applies to

Show(String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, Boolean)

Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button.

Parameters

The text to display in the message box.

The text to display in the title bar of the message box.

One of the MessageBoxButtons values that specifies which buttons to display in the message box.

One of the MessageBoxIcon values that specifies which icon to display in the message box.

One of the MessageBoxDefaultButton values that specifies the default button for the message box.

One of the MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.

true to show the Help button; otherwise, false . The default is false .

Returns

One of the DialogResult values.

Exceptions

buttons is not a member of MessageBoxButtons.

icon is not a member of MessageBoxIcon.

The defaultButton specified is not a member of MessageBoxDefaultButton.

An attempt was made to display the MessageBox in a process that is not running in User Interactive mode. This is specified by the UserInteractive property.

buttons specified an invalid combination of MessageBoxButtons.

Examples

The following code example demonstrates how to show a message box with a Help button, handle the Control.HelpRequested event, and show a custom help window in response to the event.

Remarks

A message box is a modal dialog box, which means no input (keyboard or mouse click) can occur except to objects on the modal form. The program must hide or close a modal form (typically in response to some user action) before input to another form can occur.

When the user clicks the Help button, the form that owns the message box (or the active form) receives the HelpRequested event. Handle the HelpRequested event to perform custom Help actions.

See also

Applies to

Show(IWin32Window, String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, String, HelpNavigator)

Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file and HelpNavigator .

Parameters

An implementation of IWin32Window that will own the modal dialog box.

The text to display in the message box.

The text to display in the title bar of the message box.

One of the MessageBoxButtons values that specifies which buttons to display in the message box.

One of the MessageBoxIcon values that specifies which icon to display in the message box.

One of the MessageBoxDefaultButton values that specifies the default button for the message box.

One of the MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.

The path and name of the Help file to display when the user clicks the Help button.

One of the HelpNavigator values.

Returns

One of the DialogResult values.

Exceptions

buttons is not a member of MessageBoxButtons.

icon is not a member of MessageBoxIcon.

The defaultButton specified is not a member of MessageBoxDefaultButton.

An attempt was made to display the MessageBox in a process that is not running in User Interactive mode. This is specified by the UserInteractive property.

buttons specified an invalid combination of MessageBoxButtons.

Examples

The following code example demonstrates how to show a message box parented to the main window. The message box displays a Help button. When the user clicks the Help button, the Mspaint.chm Help file is opened and the Help index tab is displayed. The example requires that the Mspaint.chm Help file is installed.

Remarks

A message box is a modal dialog box, which means no input (keyboard or mouse click) can occur except to objects on the modal form. The program must hide or close a modal form (typically in response to some user action) before input to another form can occur. You can use the owner parameter to specify a particular object, which implements the IWin32Window interface, that will serve as the dialog box’s top-level window and owner.

When the user clicks the Help button, the Help file specified in the helpFilePath parameter is opened and the Help content identified by the navigator parameter is displayed. The form that owns the message box (or the active form) also receives the HelpRequested event.

Compiled Help files provide table of contents, index, search, and keyword links in pages. You can use the following values for navigator : TableOfContents, Find, Index, or Topic.

The helpFilePath parameter can be of the form C:\path\sample.chm or /folder/file.htm.

See also

Applies to

Show(IWin32Window, String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton)

Displays a message box in front of the specified object and with the specified text, caption, buttons, icon, and default button.

Parameters

An implementation of IWin32Window that will own the modal dialog box.

The text to display in the message box.

The text to display in the title bar of the message box.

One of the MessageBoxButtons values that specifies which buttons to display in the message box.

One of the MessageBoxIcon values that specifies which icon to display in the message box.

One of the MessageBoxDefaultButton values that specifies the default button for the message box.

Returns

One of the DialogResult values.

Exceptions

buttons is not a member of MessageBoxButtons.

icon is not a member of MessageBoxIcon.

defaultButton is not a member of MessageBoxDefaultButton.

An attempt was made to display the MessageBox in a process that is not running in User Interactive mode. This is specified by the UserInteractive property.

Examples

The following code example demonstrates how to display a MessageBox with the options supported by this overload of Show. After verifying that a string variable, ServerName , is empty, the example displays a MessageBox, offering the user the option to cancel the operation. If the Show method’s return value evaluates to Yes, the form that displayed the MessageBox is closed.

Remarks

You can use the owner parameter to specify a particular object, which implements the IWin32Window interface, that will serve as the dialog box’s top-level window and owner. A message box is a modal dialog box, which means no input (keyboard or mouse click) can occur except to objects on the modal form. The program must hide or close a modal form (typically in response to some user action) before input to another form can occur.

You can have a maximum of three buttons on the message box.

See also

Applies to

Show(IWin32Window, String, String, MessageBoxButtons, MessageBoxIcon)

Displays a message box in front of the specified object and with the specified text, caption, buttons, and icon.

Parameters

An implementation of IWin32Window that will own the modal dialog box.

The text to display in the message box.

The text to display in the title bar of the message box.

One of the MessageBoxButtons values that specifies which buttons to display in the message box.

One of the MessageBoxIcon values that specifies which icon to display in the message box.

Returns

One of the DialogResult values.

Exceptions

buttons is not a member of MessageBoxButtons.

icon is not a member of MessageBoxIcon.

An attempt was made to display the MessageBox in a process that is not running in User Interactive mode. This is specified by the UserInteractive property.

Examples

The following code example demonstrates how to display a MessageBox with the options supported by this overload of Show. After verifying that a string variable, ServerName , is empty, the example displays a MessageBox, offering the user the option to cancel the operation. If the Show method’s return value evaluates to Yes, the form that displayed the MessageBox is closed.

Remarks

You can use the owner parameter to specify a particular object, which implements the IWin32Window interface, that will serve as the dialog box’s top-level window and owner. A message box is a modal dialog box, which means no input (keyboard or mouse click) can occur except to objects on the modal form. The program must hide or close a modal form (typically in response to some user action) before input to another form can occur.

Читайте также:  Hp laserjet professional m1212 mfp драйвер windows 10

You can have a maximum of three buttons on the message box.

See also

Applies to

Show(String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton)

Displays a message box with the specified text, caption, buttons, icon, and default button.

Parameters

The text to display in the message box.

The text to display in the title bar of the message box.

One of the MessageBoxButtons values that specifies which buttons to display in the message box.

One of the MessageBoxIcon values that specifies which icon to display in the message box.

One of the MessageBoxDefaultButton values that specifies the default button for the message box.

Returns

One of the DialogResult values.

Exceptions

buttons is not a member of MessageBoxButtons.

icon is not a member of MessageBoxIcon.

defaultButton is not a member of MessageBoxDefaultButton.

An attempt was made to display the MessageBox in a process that is not running in User Interactive mode. This is specified by the UserInteractive property.

Examples

The following code example demonstrates how to display a MessageBox with the options supported by this overload of Show. After verifying that a string variable, ServerName , is empty, the example displays a MessageBox with a question box icon, offering the user the option to cancel the operation. If the Show method’s return value evaluates to Yes, the form that displayed the MessageBox is closed.

Remarks

You can have a maximum of three buttons on the message box.

See also

Applies to

Show(IWin32Window, String, String, MessageBoxButtons)

Displays a message box in front of the specified object and with the specified text, caption, and buttons.

Parameters

An implementation of IWin32Window that will own the modal dialog box.

The text to display in the message box.

The text to display in the title bar of the message box.

One of the MessageBoxButtons values that specifies which buttons to display in the message box.

Returns

One of the DialogResult values.

Exceptions

buttons is not a member of MessageBoxButtons.

An attempt was made to display the MessageBox in a process that is not running in User Interactive mode. This is specified by the UserInteractive property.

Examples

The following code example demonstrates how to display a MessageBox with the options supported by this overload of Show. After verifying that a string variable, ServerName , is empty, the example displays a MessageBox, offering the user the option to cancel the operation. If the Show method’s return value evaluates to Yes, the form that displayed the MessageBox is closed.

Remarks

You can use the owner parameter to specify a particular object, which implements the IWin32Window interface, that will serve as the dialog box’s top-level window and owner. A message box is a modal dialog box, which means no input (keyboard or mouse click) can occur except to objects on the modal form. The program must hide or close a modal form (typically in response to some user action) before input to another form can occur.

You can have a maximum of three buttons on the message box.

See also

Applies to

Show(String, String, MessageBoxButtons, MessageBoxIcon)

Displays a message box with specified text, caption, buttons, and icon.

Parameters

The text to display in the message box.

The text to display in the title bar of the message box.

One of the MessageBoxButtons values that specifies which buttons to display in the message box.

One of the MessageBoxIcon values that specifies which icon to display in the message box.

Returns

One of the DialogResult values.

Exceptions

The buttons parameter specified is not a member of MessageBoxButtons.

The icon parameter specified is not a member of MessageBoxIcon.

An attempt was made to display the MessageBox in a process that is not running in User Interactive mode. This is specified by the UserInteractive property.

Examples

The following code example demonstrates one of the Show methods when handling the ComboBox.DropDown event. To run the example, paste the following code in a form and call the InitializeComboBox method from the form’s constructor or Load method.

Remarks

You can have a maximum of three buttons on the message box.

See also

Applies to

Show(IWin32Window, String, String)

Displays a message box in front of the specified object and with the specified text and caption.

Parameters

An implementation of IWin32Window that will own the modal dialog box.

The text to display in the message box.

The text to display in the title bar of the message box.

Returns

One of the DialogResult values.

Remarks

You can use the owner parameter to specify a particular object, which implements the IWin32Window interface, that will serve as the dialog box’s top-level window and owner. A message box is a modal dialog box, which means no input (keyboard or mouse click) can occur except to objects on the modal form. The program must hide or close a modal form (typically in response to some user action) before input to another form can occur.

By default, the message box displays an OK button.

Applies to

Show(String, String, MessageBoxButtons)

Displays a message box with specified text, caption, and buttons.

Parameters

The text to display in the message box.

The text to display in the title bar of the message box.

One of the MessageBoxButtons values that specifies which buttons to display in the message box.

Returns

One of the DialogResult values.

Exceptions

The buttons parameter specified is not a member of MessageBoxButtons.

An attempt was made to display the MessageBox in a process that is not running in User Interactive mode. This is specified by the UserInteractive property.

Examples

The following code example demonstrates how to display a MessageBox with the options supported by this overload of Show. After verifying that a string variable, ServerName , is empty, the example displays a MessageBox, offering the user the option to cancel the operation. If the Show method’s return value evaluates to Yes, the form that displayed the MessageBox is closed.

Remarks

You can have a maximum of three buttons on the message box.

See also

Applies to

Show(IWin32Window, String)

Displays a message box in front of the specified object and with the specified text.

Parameters

An implementation of IWin32Window that will own the modal dialog box.

The text to display in the message box.

Returns

One of the DialogResult values.

Remarks

You can use the owner parameter to specify a particular object, which implements the IWin32Window interface, that will serve as the dialog box’s top-level window and owner. A message box is a modal dialog box, which means no input (keyboard or mouse click) can occur except to objects on the modal form. The program must hide or close a modal form (typically in response to some user action) before input to another form can occur.

By default, the message box displays an OK button. The message box does not contain a caption in the title.

Applies to

Show(String, String)

Displays a message box with specified text and caption.

Parameters

The text to display in the message box.

The text to display in the title bar of the message box.

Returns

One of the DialogResult values.

Remarks

By default, the message box displays an OK button.

Applies to

Show(String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions)

Displays a message box with the specified text, caption, buttons, icon, default button, and options.

Parameters

The text to display in the message box.

The text to display in the title bar of the message box.

One of the MessageBoxButtons values that specifies which buttons to display in the message box.

One of the MessageBoxIcon values that specifies which icon to display in the message box.

One of the MessageBoxDefaultButton values that specifies the default button for the message box.

One of the MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.

Returns

One of the DialogResult values.

Exceptions

buttons is not a member of MessageBoxButtons.

icon is not a member of MessageBoxIcon.

The defaultButton specified is not a member of MessageBoxDefaultButton.

An attempt was made to display the MessageBox in a process that is not running in User Interactive mode. This is specified by the UserInteractive property.

buttons specified an invalid combination of MessageBoxButtons.

Examples

The following code example demonstrates how to display a MessageBox with the options supported by this overload of Show. After verifying that a string variable, ServerName , is empty, the example displays a MessageBox with a question box icon, offering the user the option to cancel the operation. The example uses the RightAlign member of the MessageBoxOptions enumeration to align the text to the right edge of the dialog box. If the Show method’s return value evaluates to Yes, the form that displayed the MessageBox is closed.

Remarks

You can have a maximum of three buttons on the message box.

See also

Applies to

Show(IWin32Window, String, String, MessageBoxButtons, MessageBoxIcon, MessageBoxDefaultButton, MessageBoxOptions, String, HelpNavigator, Object)

Displays a message box with the specified text, caption, buttons, icon, default button, options, and Help button, using the specified Help file, HelpNavigator , and Help topic.

Parameters

An implementation of IWin32Window that will own the modal dialog box.

The text to display in the message box.

The text to display in the title bar of the message box.

One of the MessageBoxButtons values that specifies which buttons to display in the message box.

One of the MessageBoxIcon values that specifies which icon to display in the message box.

One of the MessageBoxDefaultButton values that specifies the default button for the message box.

One of the MessageBoxOptions values that specifies which display and association options will be used for the message box. You may pass in 0 if you wish to use the defaults.

The path and name of the Help file to display when the user clicks the Help button.

One of the HelpNavigator values.

The numeric ID of the Help topic to display when the user clicks the Help button.

Returns

One of the DialogResult values.

Exceptions

buttons is not a member of MessageBoxButtons.

icon is not a member of MessageBoxIcon.

The defaultButton specified is not a member of MessageBoxDefaultButton.

An attempt was made to display the MessageBox in a process that is not running in User Interactive mode. This is specified by the UserInteractive property.

buttons specified an invalid combination of MessageBoxButtons.

Examples

The following code example demonstrates how to show a message box parented to the main window. The message box displays a Help button. When the user clicks the Help button, the Mspaint.chm Help file is opened and the Help index tab and the topic identified by the ovals keyword are displayed. The example requires that the Mspaint.chm Help file is installed.

Remarks

A message box is a modal dialog box, which means no input (keyboard or mouse click) can occur except to objects on the modal form. The program must hide or close a modal form (typically in response to some user action) before input to another form can occur. You can use the owner parameter to specify a particular object, which implements the IWin32Window interface, that will serve as the dialog box’s top-level window and owner.

When the user clicks the Help button, the Help file specified in the helpFilePath parameter is opened and the Help content identified by the navigator parameter is displayed. The form that owns the message box (or the active form) also receives the HelpRequested event.

Compiled help files provide table of contents, index, search, and keyword links in pages. You can use the following values for navigator : TableOfContents, Find, Index, or Topic.

You can use param to provide further refinement of the Topic command. If the value specified in the navigator parameter is TableOfContents, Index, or Find, this value should be null . If the navigator parameter references Topic, this value should reference an object that contains the numeric value of the topic to display.

Оцените статью