DialogsErrorMessage(String) Method

Shows an error message dialog with an OK button.

Definition

Namespace: KGySoft.WinForms.Forms
Assembly: KGySoft.WinForms (in KGySoft.WinForms.dll) Version: 5.0.1
C#
public static void ErrorMessage(
	string message
)

Parameters

message  String
The message to display in the error dialog.

Remarks

  Note

In versions prior to 5.0.0, the message was translated by the obsolete Language class. Since version 5.0.0, the message is expected to be already localized. To use the same dynamic localization as BaseForm or BaseUserControl when their DynamicStringLocalization property is set to AssemblyScope or LocalScope, you can use the LocalizationHelper.GetString method. To localize the window caption, you can use the ErrorMessage(IWin32Window, String, String) overload and pass a custom localized string to the caption parameter. To localize both the window caption and buttons, opt-in to use task dialogs by setting the UseTaskDialogs property to , and set the LanguageSettings.DynamicResourceManagersSource auto-generated KGySoft.WinForms.Messages.<LanguageId>.resx files in the Resources folder of the executing application.

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.

See Also