# IMessageBoxService.Show method (1 of 2)

Shows a modal message box owned by the active application window.

```csharp
public DialogResult Show(string text, string caption, MessageBoxButtons buttons, 
    MessageBoxIcon icon)
```

| parameter | description |
| --- | --- |
| text | The message shown in the body of the message box. |
| caption | The window caption. |
| buttons | The set of buttons to offer. |
| icon | The icon shown next to the message. |

## Return Value

The button the user pressed.

## See Also

* enum [DialogResult](../DialogResult.md)
* enum [MessageBoxButtons](../../Eremex.AvaloniaUI.Controls/MessageBoxButtons.md)
* enum [MessageBoxIcon](../../Eremex.AvaloniaUI.Controls/MessageBoxIcon.md)
* interface [IMessageBoxService](../IMessageBoxService.md)
* namespace [Eremex.AvaloniaUI.Controls.ApplicationServices](../index.md)

---

# IMessageBoxService.Show method (2 of 2)

Shows a modal message box owned by the specified window.

```csharp
public DialogResult Show(IWindow? owner, string text, string caption, MessageBoxButtons buttons, 
    MessageBoxIcon icon)
```

| parameter | description |
| --- | --- |
| owner | The window the message box is shown on top of. When `null`, the active application window is used. |
| text | The message shown in the body of the message box. |
| caption | The window caption. |
| buttons | The set of buttons to offer. |
| icon | The icon shown next to the message. |

## Return Value

The button the user pressed.

## See Also

* enum [DialogResult](../DialogResult.md)
* interface [IWindow](../IWindow.md)
* enum [MessageBoxButtons](../../Eremex.AvaloniaUI.Controls/MessageBoxButtons.md)
* enum [MessageBoxIcon](../../Eremex.AvaloniaUI.Controls/MessageBoxIcon.md)
* interface [IMessageBoxService](../IMessageBoxService.md)
* namespace [Eremex.AvaloniaUI.Controls.ApplicationServices](../index.md)

<!-- DO NOT EDIT: generated by xmldocmd for Eremex.Common.Contracts.dll -->
