DialogsCancellableConfirmMessage(IWin32Window, String, String, MessageBoxDefaultButton) Method

Shows a confirmation message dialog with Yes, No and Cancel buttons.

Definition

Namespace: KGySoft.WinForms.Forms
Assembly: KGySoft.WinForms (in KGySoft.WinForms.dll) Version: 5.0.1
C#
public static bool? CancellableConfirmMessage(
	IWin32Window? owner,
	string message,
	string? caption = null,
	MessageBoxDefaultButton defaultButton = MessageBoxDefaultButton.Button1
)

Parameters

owner  IWin32Window
An optional window that will own the modal message dialog. If , the DialogsOwner property will be taken. If DialogsOwner is also , the currently active window will be used.
message  String
The message to display in the confirmation dialog.
caption  String  (Optional)
The caption of the dialog. If , a localized string similar to Confirmation will be used. This parameter is optional.
Default value: .
defaultButton  MessageBoxDefaultButton  (Optional)
The default button to select when the dialog is shown. This parameter is optional.
Default value: Button1 (i.e. Yes is the default button).

Return Value

NullableBoolean
if the user clicked Yes, if No was clicked, or if Cancel was clicked or the dialog was closed.

Remarks

This overload sets the DialogsOwner as the owner of the dialog; or, if it is , the currently active window will be the owner.

To use a right-to-left layout when the UI culture of the current thread is a right-to-left language, set the AutoRightToLeftLayout property to before calling this method.

To show also only Yes and No buttons, use the ConfirmMessage methods instead.

See Also