NTMessageBoxSimple.Show()

View as Markdown

Definition

Creates a message box window.

For more information on using MessageBox windows, please see .NET MessageBox Class Documentation here.

Method Return Value

MessageBoxResult; an enum representing the button press used to close the MessageBox window.

Syntax

NTMessageBoxSimple.Show(Window input, string messageTxt, string caption, MessageBoxButton buttonSet, MessageBoxImage icon)

Parameters

ParameterDescription
parentA Window (DependencyObject) which represents the owning window
messageTxtThe message body of the MessageBox window
captionThe header of the MessageBox window
buttonSetA MesageBoxButton enum determining the buttons used for the MessageBox window
iconA MesageBoxImage enum determining the icon used for the MessageBox window

Examples

1// Create a MessageBox window from a Chart
2ChartControl.Dispatcher.InvokeAsync(new Action(() => {
3 NinjaTrader.Gui.Tools.NTMessageBoxSimple.Show(Window.GetWindow(ChartControl.OwnerChart as DependencyObject), "Message Body", "Message Header", MessageBoxButton.OK, MessageBoxImage.None);
4}));
5
6// Create a MessageBox window from a button press in an AddOn**
7private void OnMenuItemClick(object sender, RoutedEventArgs e)
8{
9 NinjaTrader.Gui.Tools.NTMessageBoxSimple.Show(Window.GetWindow(e.Source as DependencyObject), "Message Body", "Message Header", MessageBoxButton.OK, MessageBoxImage.None);