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 QuitKey.

Remarks

The MessageBox is centered and auto-sized based on title, message, and buttons.

Exceptions

ArgumentNullException

Thrown if app is null.

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

Displays an auto-sized error MessageBox with a default button and word-wrap control.

public static int? ErrorQuery(IApplication app, string title, string message, int defaultButton = 0, 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.

defaultButton int

Index of the default button (0-based).

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 QuitKey.

Remarks

The MessageBox is centered and auto-sized based on title, message, and buttons.

Exceptions

ArgumentNullException

Thrown if app is null.