Table of Contents

Method ErrorQuery

Namespace
Terminal.Gui.Views
Assembly
Terminal.Gui.dll

ErrorQuery(IApplication, string, string, params string[])

Displays an auto-sized error MessageBox.

public static int? ErrorQuery(IApplication app, string title, string message, params string[] buttons)

Parameters

app IApplication

The application instance. If null, uses TopRunnableView.

title string

Title for the MessageBox.

message string

Message to display. May contain multiple lines and will be word-wrapped.

buttons string[]

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 app is null.

ErrorQuery(IApplication, string, string, bool, params string[])

Displays an auto-sized error MessageBox with word-wrap control.

public static int? ErrorQuery(IApplication app, string title, string message, bool wrapMessage = true, params string[] buttons)

Parameters

app IApplication

The application instance. If null, uses TopRunnableView.

title string

Title for the MessageBox.

message string

Message to display. May contain multiple lines.

wrapMessage bool

If true, word-wraps the message; otherwise displays as-is with multi-line support.

buttons string[]

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 app is null.