Skip to main content

MessageBox Class

Namespace: GHIElectronics.TinyCLR.UI.Controls · Assembly: GHIElectronics.TinyCLR.UI

WinForms-style modal message box. Usage: MessageBox.DefaultFont = myFont; // once at app start var r = MessageBox.Show("Erase all data?", "Confirm", MessageBoxButtons.YesNo); if (r == DialogResult.Yes) { ... } Show() is synchronous: it nests a dispatcher frame so the UI keeps painting and dispatching input while the box is up, and returns when the user picks a button (or Esc cancels). Safe to call from any UI-thread event handler.

public static class MessageBox

Properties

DefaultFont

public static Font DefaultFont { get; set; }

Optional default font. Set this once at startup so callers don't have to pass a Font on every call. Each Show overload that omits a Font uses this value.

Methods

Show(string message, string caption, MessageBoxButtons buttons)

public static DialogResult Show(string message, string caption, MessageBoxButtons buttons)

No description available.

ParameterTypeDescription
messagestring
captionstring
buttonsMessageBoxButtons

Returns DialogResult

Show(string message, string caption, MessageBoxButtons buttons, Font font)

public static DialogResult Show(string message, string caption, MessageBoxButtons buttons, Font font)

No description available.

ParameterTypeDescription
messagestring
captionstring
buttonsMessageBoxButtons
fontFont

Returns DialogResult

Show(UIElement owner, string message, string caption, MessageBoxButtons buttons, Font font)

public static DialogResult Show(UIElement owner, string message, string caption, MessageBoxButtons buttons, Font font)

No description available.

ParameterTypeDescription
ownerUIElement
messagestring
captionstring
buttonsMessageBoxButtons
fontFont

Returns DialogResult