/// <summary> /// Show a modal rad alert box /// This static method was implemented following the Microsoft pattern for the standard WPF MessageBox /// but is using the telerik RadWindow internally /// </summary> /// <param name="ctrlOwner">The owner window if needed otherwise null</param> /// <param name="strMessage">The message to display</param> /// <param name="strCaption">The title of the message box window. (Parameter is optional)</param> /// <param name="button">The buttons the dialog should have - Default is ok</param> /// <param name="image">The image the dialog should hold - Default is Warning</param> /// <returns>A message box result enum with the result of the dialog</returns> public static MessageBoxResult Show(ContentControl ctrlOwner, string strMessage, string strCaption = null, MessageBoxButton button = MessageBoxButton.OK, MessageBoxImage image = MessageBoxImage.Information) { try { ZMXUC_MessageBoxERP dlg = new ZMXUC_MessageBoxERP(); dlg.DialogImage = image; dlg.Buttons = button; dlg.Header = string.Empty; if (strCaption != null) { dlg.Header = strCaption; } dlg.txtMessage.Text = strMessage; if (ctrlOwner != null) { dlg.Owner = ctrlOwner; } dlg.IsTopmost = true; dlg.ShowDialog(); MessageBoxResult res = dlg.Result; return(res); } catch (Exception err) { System.Diagnostics.Trace.TraceError(err.ToString()); return(MessageBoxResult.None); } }
/// <summary> /// Show a modal MessageBoxERP with a message a window title, configure the buttons to display and set the dialogs image /// </summary> /// <param name="strMessage">The message string to show</param> /// <param name="strCaption">The title of the message box window.(Parameter is optional)</param> /// <param name="button">The buttons the dialog should have - Default is ok</param> /// <param name="image">The image the dialog should hold - Default is Warning</param> public static MessageBoxResult Show(string strMessage, string strCaption, MessageBoxButton button, MessageBoxImage image) { return(ZMXUC_MessageBoxERP.Show(null, strMessage, strCaption, button, image)); }
/// <summary> /// Show a modal MessageBoxERP with a message a window title and configure the buttons to display /// </summary> /// <param name="strMessage">The message string to show</param> /// <param name="strCaption">The title of the message box window.(Parameter is optional)</param> /// <param name="button">The buttons the dialog should have - Default is ok</param> public static void Show(string strMessage, string strCaption, MessageBoxButton button) { ZMXUC_MessageBoxERP.Show(null, strMessage, strCaption, button); }
/// <summary> /// Show a modal MessageBoxERP with a message and the window title as option /// </summary> /// <param name="strMessage">The message string to show</param> /// <param name="strCaption">The title of the message box window.(Parameter is optional)</param> public static void Show(string strMessage, string strCaption = null) { ZMXUC_MessageBoxERP.Show(null, strMessage, strCaption); }