Method Query
Query(IApplication, int, int, string, string, params string[])
Displays a MessageBox with fixed dimensions.
public static int? Query(IApplication app, int width, int height, string title, string message, params string[] buttons)
Parameters
appIApplicationThe application instance. If null, uses TopRunnableView.
widthintWidth for the MessageBox.
heightintHeight for the MessageBox.
titlestringTitle for the MessageBox.
messagestringMessage to display. May contain multiple lines and will be word-wrapped.
buttonsstring[]Array of button labels.
Returns
- int?
The index of the selected button, or null if the user pressed GetDefaultKey(Command).
Remarks
Consider using Query(IApplication, string, string, params string[]) which automatically sizes the MessageBox. The last button is the default button.
Exceptions
- ArgumentNullException
Thrown if
appis null.
Query(IApplication, string, string, params string[])
Displays an auto-sized MessageBox.
public static int? Query(IApplication app, string title, string message, params string[] buttons)
Parameters
appIApplicationThe application instance. If null, uses TopRunnableView.
titlestringTitle for the MessageBox.
messagestringMessage to display. May contain multiple lines and will be word-wrapped.
buttonsstring[]Array of button labels.
Returns
- int?
The index of the selected button, or null if the user pressed GetDefaultKey(Command).
Remarks
The MessageBox is centered and auto-sized based on title, message, and buttons. The last button is the default button.
Exceptions
- ArgumentNullException
Thrown if
appis null.
Query(IApplication, string, string, bool, params string[])
Displays an auto-sized MessageBox with word-wrap control.
public static int? Query(IApplication app, string title, string message, bool wrapMessage = true, params string[] buttons)
Parameters
appIApplicationThe application instance. If null, uses TopRunnableView.
titlestringTitle for the MessageBox.
messagestringMessage to display. May contain multiple lines.
wrapMessageboolIf true, word-wraps the message; otherwise displays as-is with multi-line support.
buttonsstring[]Array of button labels.
Returns
- int?
The index of the selected button, or null if the user pressed GetDefaultKey(Command).
Remarks
The MessageBox is centered and auto-sized based on title, message, and buttons. The last button is the default button.
Exceptions
- ArgumentNullException
Thrown if
appis null.