Table of Contents

Method Query

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

Query(int, int, ustring, ustring, params ustring[])

Presents a normal MessageBox with the specified title and message and a list of buttons to show to the user.

public static int Query(int width, int height, ustring title, ustring message, params ustring[] buttons)

Parameters

width int

Width for the window.

height int

Height for the window.

title ustring

Title for the query.

message ustring

Message to display, might contain multiple lines.

buttons ustring[]

Array of buttons to add.

Returns

int

The index of the selected button, or -1 if the user pressed ESC to close the dialog.

Remarks

Use Query(ustring, ustring, params ustring[]) instead; it automatically sizes the MessageBox based on the contents.

Query(ustring, ustring, params ustring[])

Presents an error MessageBox with the specified title and message and a list of buttons to show to the user.

public static int Query(ustring title, ustring message, params ustring[] buttons)

Parameters

title ustring

Title for the query.

message ustring

Message to display, might contain multiple lines.

buttons ustring[]

Array of buttons to add.

Returns

int

The index of the selected button, or -1 if the user pressed ESC to close the dialog.

Remarks

The message box will be vertically and horizontally centered in the container and the size will be automatically determined from the size of the message and buttons.

Query(int, int, ustring, ustring, int, params ustring[])

Presents a normal MessageBox with the specified title and message and a list of buttons to show to the user.

public static int Query(int width, int height, ustring title, ustring message, int defaultButton = 0, params ustring[] buttons)

Parameters

width int

Width for the window.

height int

Height for the window.

title ustring

Title for the query.

message ustring

Message to display, might contain multiple lines.

defaultButton int

Index of the default button.

buttons ustring[]

Array of buttons to add.

Returns

int

The index of the selected button, or -1 if the user pressed ESC to close the dialog.

Remarks

Use Query(ustring, ustring, params ustring[]) instead; it automatically sizes the MessageBox based on the contents.

Query(ustring, ustring, int, params ustring[])

Presents an error MessageBox with the specified title and message and a list of buttons to show to the user.

public static int Query(ustring title, ustring message, int defaultButton = 0, params ustring[] buttons)

Parameters

title ustring

Title for the query.

message ustring

Message to display, might contain multiple lines.

defaultButton int

Index of the default button.

buttons ustring[]

Array of buttons to add.

Returns

int

The index of the selected button, or -1 if the user pressed ESC to close the dialog.

Remarks

The message box will be vertically and horizontally centered in the container and the size will be automatically determined from the size of the message and buttons.

Query(int, int, ustring, ustring, int, Border, params ustring[])

Presents a normal MessageBox with the specified title and message and a list of buttons to show to the user.

public static int Query(int width, int height, ustring title, ustring message, int defaultButton = 0, Border border = null, params ustring[] buttons)

Parameters

width int

Width for the window.

height int

Height for the window.

title ustring

Title for the query.

message ustring

Message to display, might contain multiple lines.

defaultButton int

Index of the default button.

border Border

The border settings.

buttons ustring[]

Array of buttons to add.

Returns

int

The index of the selected button, or -1 if the user pressed ESC to close the dialog.

Remarks

Use Query(ustring, ustring, params ustring[]) instead; it automatically sizes the MessageBox based on the contents.

Query(ustring, ustring, int, Border, params ustring[])

Presents an error MessageBox with the specified title and message and a list of buttons to show to the user.

public static int Query(ustring title, ustring message, int defaultButton = 0, Border border = null, params ustring[] buttons)

Parameters

title ustring

Title for the query.

message ustring

Message to display, might contain multiple lines.

defaultButton int

Index of the default button.

border Border

The border settings.

buttons ustring[]

Array of buttons to add.

Returns

int

The index of the selected button, or -1 if the user pressed ESC to close the dialog.

Remarks

The message box will be vertically and horizontally centered in the container and the size will be automatically determined from the size of the message and buttons.