public void ShowMessage(string message, string titulo, MessageBoxType TypeMessage) { switch (TypeMessage) { case MessageBoxType.Error: this.ErrorBox1.ShowMessage(message, titulo); break; case MessageBoxType.Alert: this.AlertBox1.ShowMessage(message, titulo); break; case MessageBoxType.Question: this.QuestionBox1.ShowMessage(message, titulo); break; case MessageBoxType.Information: this.InformationBox1.ShowMessage(message, titulo); break; case MessageBoxType.Success: this.SuccessBox1.ShowMessage(message, titulo); break; default: throw new Exception("Invalid MessageBoxType!"); break; } }
public static void ShowMessageBox(Control p, string Message, string BoxTitle, MessageBoxType type) { Message = Message.Replace("\r\n", ""); Message = Message.Replace("<BR>", "{BR}"); Message = Message.Replace("<", "{START}"); Message = Message.Replace(">", "{END}"); Message = Message.Replace("\"", "{Q}"); string ImagePath = string.Format(p.ResolveUrl("~/App_Themes/MessageBox/{0}.png"), type.GetEnumName()); string script = string.Format(@"<script type=""text/javascript""> ShowJQMessageBox(' <fieldset style=""direction:rtl;width:400px;max-width:600px;min-width: 300px;"" align=""center""><legend><img align=""middle"" src=""{0}"" Width=""32"" />{1} </legend> <span style=""direction:rtl;text-align:right"">{2}</span></fieldset>'); </script>", ImagePath, BoxTitle, HttpContext.Current.Server.HtmlEncode(Message)); script = script.Replace("{BR}", "<BR>"); script = script.Replace("{START}", "<"); script = script.Replace("{END}", ">"); script = script.Replace("{Q}", "\""); ScriptManager.RegisterClientScriptBlock(p, p.GetType(), "message", script, false); }
public static DialogResult Show (Generator g, Control parent, string text, string caption, MessageBoxButtons buttons, MessageBoxType type = MessageBoxType.Information) { var mb = g.CreateControl<IMessageBox> (); mb.Text = text; mb.Caption = caption; mb.Type = type; return mb.ShowDialog (parent, buttons); }
public MessageBox(Manager manager, MessageBoxType type) : base(manager) { Type = type; buttons = new List<Button>(); Init(); manager.Add(window); Pop(); }
public async Task ShowMessageAsync(MessageBoxType messageBoxType, string title, string message) { switch (messageBoxType) { case MessageBoxType.Generic: await this.MainPage.DisplayAlert(title, message, "OK", "Cancel"); break; } }
public async Task ShowMessageAsync(MessageBoxType messageBoxType) { switch (messageBoxType) { case MessageBoxType.TextUpdate: await this.MainPage.DisplayAlert("title here", "the text in the control has updated", "OK", "Close"); break; } }
public static void Show(MessageBoxType messageBoxType, String title, String message, Window parentWindow = null) { IntPtr parentWindowHandle = IntPtr.Zero; if (parentWindow != null) parentWindowHandle = parentWindow.Handle; SDL.SDL_ShowSimpleMessageBox((SDL.SDL_MessageBoxFlags)messageBoxType, title, message, parentWindowHandle); }
public MessageBox(Manager manager, MessageBoxType type, String _message, String _title) : base(manager) { Type = type; buttons = new List<Button>(); message = _message; title = _title; Init(); manager.Add(window); Pop(); }
public static IEnumerable Pop(String message, MessageBoxType type, ReturnTuple<MessageBoxResult> result) { if (result != null) result.value_0 = MessageBoxResult.None; UIPanelUpdateMessageBox dialog = Show(message, type, (ret)=>{ if (result != null) result.value_0=ret; }); GameObject gameObject = dialog.gameObject; while (gameObject && gameObject.activeSelf) { yield return null; } }
public static Gtk.MessageType Convert(MessageBoxType type) { switch (type) { default: case MessageBoxType.Information: return Gtk.MessageType.Info; case MessageBoxType.Error: return Gtk.MessageType.Error; case MessageBoxType.Warning: return Gtk.MessageType.Warning; case MessageBoxType.Question: return Gtk.MessageType.Question; } }
public static SWF.MessageBoxIcon Convert(MessageBoxType type) { switch (type) { case MessageBoxType.Error: return SWF.MessageBoxIcon.Error; case MessageBoxType.Warning: return SWF.MessageBoxIcon.Warning; case MessageBoxType.Information: return SWF.MessageBoxIcon.Information; case MessageBoxType.Question: return SWF.MessageBoxIcon.Question; default: throw new NotSupportedException(); } }
/// <inheritdoc/> public void ShowMessageBox(MessageBoxType type, String title, String message, IUltravioletWindow parent = null) { Contract.EnsureNotDisposed(this, Disposed); if (parent == null) parent = Windows.GetPrimary(); var flags = GetSDLMessageBoxFlag(type); var window = (parent == null) ? IntPtr.Zero : (IntPtr)((OpenGLUltravioletWindow)parent); if (SDL.ShowSimpleMessageBox(flags, title, message, window) < 0) throw new SDL2.SDL2Exception(); }
NSAlertStyle Convert (MessageBoxType type) { switch (type) { case MessageBoxType.Information: case MessageBoxType.Question: return NSAlertStyle.Informational; case MessageBoxType.Warning: return NSAlertStyle.Warning; case MessageBoxType.Error: return NSAlertStyle.Critical; default: throw new NotSupportedException (); } }
System.Windows.MessageBoxImage Convert(MessageBoxType type) { switch (type) { default: case MessageBoxType.Information: return System.Windows.MessageBoxImage.Information; case MessageBoxType.Error: return System.Windows.MessageBoxImage.Error; case MessageBoxType.Question: return System.Windows.MessageBoxImage.Question; case MessageBoxType.Warning: return System.Windows.MessageBoxImage.Warning; } }
public void RenderMessage(MessageBoxType messageType, string message, string description, Exception ex, params string[] additionalParameters) { this.Visible = true; // show message // set icon and styles string boxStyle = "MessageBox Green"; if (messageType == MessageBoxType.Warning) boxStyle = "MessageBox Yellow"; else if (messageType == MessageBoxType.Error) boxStyle = "MessageBox Red"; tblMessageBox.Attributes["class"] = boxStyle; // set texts litMessage.Text = message; litDescription.Text = !String.IsNullOrEmpty(description) ? String.Format("<br/><span class=\"description\">{0}</span>", description) : ""; // show exception if (ex != null) { // show error try { // technical details litPageUrl.Text = PortalAntiXSS.Encode(Request.Url.ToString()); litLoggedUser.Text = PanelSecurity.LoggedUser.Username; litSelectedUser.Text = PanelSecurity.SelectedUser.Username; litPackageName.Text = PanelSecurity.PackageId.ToString(); litStackTrace.Text = ex.ToString().Replace("\n", "<br/>"); // send form litSendFrom.Text = PanelSecurity.LoggedUser.Email; if (!String.IsNullOrEmpty(PortalUtils.FromEmail)) litSendFrom.Text = PortalUtils.FromEmail; //litSendTo.Text = this.PortalSettings.Email; litSendTo.Text = PortalUtils.AdminEmail; litSendCC.Text = PanelSecurity.LoggedUser.Email; litSendSubject.Text = GetLocalizedString("Text.Subject"); } catch { /* skip */ } } else { rowTechnicalDetails.Visible = false; } }
/// <summary> /// 显示提示框 /// </summary> /// <param name="type"></param> /// <param name="msg"></param> public void ShowMessageBox(MessageBoxType type, string msg) { switch (type) { case MessageBoxType.Infomation: MessageBox.Show(msg, "提示", MessageBoxButton.OK, MessageBoxImage.Information); break; case MessageBoxType.Warning: MessageBox.Show(msg, "警告", MessageBoxButton.OKCancel, MessageBoxImage.Information); break; case MessageBoxType.Error: MessageBox.Show(msg, "错误", MessageBoxButton.OK, MessageBoxImage.Information); break; } }
public SuperMessageBox(string caption, string message, MessageBoxType messageBoxType, Action callbackOnYes = null, Action callbackOnNo = null, Action callbackOnCancel = null) { InitializeComponent(); _callbackOnYes = callbackOnYes; _callbackOnNo = callbackOnNo; _callbackOnCancel = callbackOnCancel; MessageBoxType = messageBoxType; Caption = caption; Text = message; Content.YesClicked += YesButtonClick; Content.NoClicked += NoButtonClick; Content.CancelClicked += CancelButtonClick; }
public MessageBoxScreen(string message, bool includeUsageText, MessageBoxType type) { Type = type; ConstructMessageBox(); if (includeUsageText) Message = message + _usageText; else Message = message; IsPopup = true; TransitionOnTime = TimeSpan.FromSeconds(0.2); TransitionOffTime = TimeSpan.FromSeconds(0.2); FadeBackground = true; }
public static MessageBoxResult Show(string caption, string msg, MessageBoxType type) { switch (type) { case MessageBoxType.ConfirmationWithYesNo: return Show(caption, msg, MessageBoxButton.YesNo, MessageBoxImage.Question); case MessageBoxType.ConfirmationWithYesNoCancel: return Show(caption, msg, MessageBoxButton.YesNoCancel, MessageBoxImage.Question); case MessageBoxType.Information: return Show(caption, msg, MessageBoxButton.OK, MessageBoxImage.Information); case MessageBoxType.Error: return Show(caption, msg, MessageBoxButton.OK, MessageBoxImage.Error); case MessageBoxType.Warning: return Show(caption, msg, MessageBoxButton.OK, MessageBoxImage.Warning); default: return MessageBoxResult.No; } }
public void SetMessageAndType(string message,MessageBoxType messageBoxType){ transform.FindChild ("Message").GetComponent<UILabel> ().text = message; Transform okButton = transform.FindChild ("OKBtn"); Transform cancelButton = transform.FindChild ("CancelBtn"); EventDelegate.Add(okButton.GetComponent<UIEventTrigger> ().onClick, OnClickOK); switch (messageBoxType) { case MessageBoxType.OK: okButton.localPosition = new Vector3 (0, okButton.localPosition.y); cancelButton.gameObject.SetActive (false); break; case MessageBoxType.OKCancel: EventDelegate.Add(cancelButton.GetComponent<UIEventTrigger> ().onClick, OnClickCancel); cancelButton.gameObject.SetActive (true); break; default: break; } }
public static void Create(string caption, string text, MessageBoxType boxType = MessageBoxType.None) { MessageBoxIcon icon; switch (boxType) { case MessageBoxType.Error: icon = MessageBoxIcon.Error; break; case MessageBoxType.Warning: icon = MessageBoxIcon.Information; break; case MessageBoxType.Information: icon = MessageBoxIcon.Warning; break; default: icon = MessageBoxIcon.None; break; } MessageBox.Show(text, caption, MessageBoxButtons.OK, icon); }
/// <summary> /// Show a MessageBox. /// </summary> /// <param name="mbType">The type of the MessageBox</param> /// <param name="text">The text that is being displayed inside the MessageBox</param> /// <param name="owner">The owner of the MessageBox.</param> public static DialogResult ShowMessageBox(MessageBoxType mbType, string text, IWin32Window owner) { MessageBoxIcon mbIcon; MessageBoxButtons mbButtons; string caption; switch (mbType) { case MessageBoxType.Error: mbIcon = MessageBoxIcon.Error; mbButtons = MessageBoxButtons.OK; caption = Localization.CtrlMbCaptionError; break; case MessageBoxType.Info: mbIcon = MessageBoxIcon.Information; mbButtons = MessageBoxButtons.OK; caption = Localization.CtrlMbCaptionInfo; break; case MessageBoxType.Question: mbIcon = MessageBoxIcon.Question; mbButtons = MessageBoxButtons.YesNo; caption = Localization.CtrlMbCaptionQuestion; break; case MessageBoxType.Warning: mbIcon = MessageBoxIcon.Warning; mbButtons = MessageBoxButtons.YesNo; caption = Localization.CtrlMbCaptionWarning; break; default: mbIcon = MessageBoxIcon.None; mbButtons = MessageBoxButtons.OK; caption = string.Empty; break; } // display messagebox return MessageBox.Show(owner, text, caption, mbButtons, mbIcon, MessageBoxDefaultButton.Button1); }
public static UIPanelUpdateMessageBox Show(String message, MessageBoxType type, Action<MessageBoxResult> callback) { String prefabName = "ui/prefab/panel_updatemessagebox"; UIPanelUpdateMessageBox dialog = ECUpdateUIManagerInstance.Value.CreateDialog<UIPanelUpdateMessageBox>(prefabName); UpdateMsgBoxSleepControl.AddSleepControl(dialog.gameObject, 30, (Int32)SleepTimeoutManager.Priority.MessageBox); switch (type) { case MessageBoxType.OK: dialog.EnabelYes(); if (callback != null) dialog.SetYesHandle(()=>callback(MessageBoxResult.OK)); break; case MessageBoxType.YES_NO: dialog.EnabelYesNO(); if (callback != null) { dialog.SetYesHandle(()=>callback(MessageBoxResult.YES)); dialog.SetNoHandle(()=>callback(MessageBoxResult.NO)); } break; case MessageBoxType.OK_CANCEL: dialog.EnableYesCancle(); if (callback != null) { dialog.SetYesHandle(()=>callback(MessageBoxResult.OK)); dialog.SetNoHandle(()=>callback(MessageBoxResult.CANCEL)); } break; } dialog.Txt_Message.supportEncoding = true; dialog.Txt_Message.text = message; dialog.gameObject.SetActive(true); return dialog; }
public static DialogResult Show(Generator g, Control parent, string text, MessageBoxButtons buttons, MessageBoxType type = MessageBoxType.Information) { return(Show(g, parent, text, null, buttons, type)); }
public async Task <bool> PromptAsync(string content, MessageBoxType type, MessageBoxResult expected, IDialogResourceResolver resolver = null) => await PromptAsync(string.Empty, content, type, expected, resolver);
public void ShowMessage(string strMessage, MessageBoxType MessageType) { if (MessageType == MessageBoxType.Information) { string sPath = System.Web.HttpContext.Current.Request.Path.ToLower(); string mRootPath = sPath.Substring(0, sPath.IndexOf("/", 1) + 1); string sUrl = "http://" + this.ServerIP + mRootPath + "Message.aspx?"; strMessage = strMessage.Replace("\r", ""); strMessage = strMessage.Replace("\n", ""); string strmsg = @"<script language='javascript'> function utfurlcode(src) { //编码 var strRet, I, innerCode, H4, M6, L6; strRet = ''; for(I = 0; I < src.length; I++) { innerCode = src.charCodeAt(I); if(innerCode < 0) { innerCode += 0x10000; } if(innerCode < 0x80) { strRet += src.charAt(I); } else { H4 = 0xe0 + ((innerCode & 0xf000) >> 12); M6 = 0x80 + ((innerCode & 0xfc0) >> 6); L6 = 0x80 + (innerCode & 0x3f); strRet += '%' + H4.toString(16) + '%' + M6.toString(16) + '%' + L6.toString(16); } } return strRet; } //内部弹出模态窗体公用函数 function pdmmsgbox(btntype,msg) { //alert(msg); msg=msg.replace(""<"",""[""); msg=msg.replace("">"",""]""); msg=utfurlcode(msg); var tmp='btntype=' + btntype + '&msg=' + msg ; path='" + sUrl + @"' + tmp; //if (getHTTPData(path).indexOf('系统提示') ==-1 ) //{ // path='../../Message.aspx?' + tmp; //} var l=(screen.width-350)/2; var t=(screen.height-200)/2; var Rv=showModalDialog(path,'','status:no;dialogHeight: 200px; dialogWidth: 350px; dialogTop: ' + t + 'px; dialogLeft: ' + l + 'px'); return Rv; } var Rv=pdmmsgbox(3,'" + strMessage + @"'); </script>" ; System.Web.HttpContext.Current.Response.Write(strmsg); } else { ShowMessage(strMessage); } }
public static DialogResult Show(Generator generator, Control parent, string text, MessageBoxButtons buttons, MessageBoxType type = MessageBoxType.Information, MessageBoxDefaultButton defaultButton = MessageBoxDefaultButton.Default) { return Show(generator, parent, text, null, buttons, type, defaultButton); }
public static DialogResult Show(Generator generator, Control parent, string text, string caption = null, MessageBoxType type = MessageBoxType.Information) { return(Show(generator, parent, text, caption, MessageBoxButtons.OK, type)); }
/// <summary> /// 消息构造函数 /// </summary> /// <param name="owner">父窗口</param> /// <param name="errorcode">错误code</param> /// <param name="strmessage">错误message</param> /// <param name="caption">标题</param> /// <param name="button">按钮类型</param> /// <param name="icon"></param> public MvMessageBox(string errorcode, string strmessage, string caption, MessageBoxButton button, MessageBoxType icon, Window owner = null) { InitializeComponent(); this.Caption = caption; this.ErrorCode = errorcode; this.Message = strmessage; this.MsgButton = button; this.MsgIcon = icon; if (owner != null) { this.Owner = owner; if (!string.IsNullOrEmpty(errorcode)) { owner.Tag = this; } } SetUIText(); SetIcon(); SetMessageType(); }
public static DialogResult Show(Generator g, Control parent, string text, string caption, MessageBoxButtons buttons, MessageBoxType type = MessageBoxType.Information) { var mb = g.CreateHandler <IMessageBox> (); mb.Text = text; mb.Caption = caption; mb.Type = type; return(mb.ShowDialog(parent, buttons)); }
public static DialogResult Show(string text, string caption, MessageBoxType type = MessageBoxType.Information) { return(Show(null, text, caption, type)); }
public void RenderMessage(string[] messages, MessageBoxType messageType, string messageKey, string errorMessageKeyPrefix) { divMessageBox.Visible = true; ViewState["JustRendered"] = true; string prefix = "Success."; // set icon and styles string boxStyle = "MessageBox Green"; if (messageType == MessageBoxType.Warning) { boxStyle = "MessageBox Yellow"; prefix = "Warning."; } else if (messageType == MessageBoxType.Error) { boxStyle = "MessageBox Red"; prefix = "Error."; } divMessageBox.Attributes["class"] = boxStyle; string localizedMsg = GetSharedLocalizedString(prefix + messageKey); if (String.IsNullOrEmpty(localizedMsg)) { localizedMsg = messageKey; } litMessage.Text = localizedMsg; // detailed messages StringBuilder sb = new StringBuilder(); foreach (string str in messages) { string key = str; string[] parts = null; int idx = str.IndexOf(":"); if (idx != -1) { parts = new string[] { str.Substring(0, idx), str.Substring(idx + 1) }; key = parts[0]; } // first attempt string localizedStr = GetSharedLocalizedString(string.Format("{0}{1}", prefix, key)); if (localizedStr == null) { localizedStr = GetSharedLocalizedString(string.Format("{0}{1}", "Warning.", key)); } // second attempt if (localizedStr == null) { localizedStr = GetSharedLocalizedString(string.Format("{0}.{1}", errorMessageKeyPrefix, key)); } if (parts != null && localizedStr != null) { localizedStr = String.Format(localizedStr, parts); } if (String.IsNullOrEmpty(localizedStr)) { localizedStr = str; } sb.Append("- "); sb.Append(localizedStr); sb.Append("<br/>"); } string description = sb.ToString(); litDescription.Text = !String.IsNullOrEmpty(description) ? String.Format("<br/><span class=\"description\">{0}</span>", description) : ""; }
/// <summary> /// Call this to show a new MessageBox /// </summary> /// <param name="text">The text message which should be displayed to the user</param> /// <param name="type">The type of the MessageBox</param> public static void Show(string text, MessageBoxType type) { Show(text, type, false, Vector3.zero, Quaternion.identity); }
public static extern int MessageBox(IntPtr hWnd, string text, string caption, MessageBoxType type);
public MessageBox(string message, string title = "", MessageBoxType messageBoxType = MessageBoxType.Ok) { this.InitializeComponent(); DataContext = new MessageBoxViewModel(this, message, title, messageBoxType); Activate(); }
public static async Task <bool> ShowDialog(Window window, string message, string title = "", MessageBoxType messageBoxType = MessageBoxType.Ok) { var messageBox = new MessageBox(message, title, messageBoxType); return(await messageBox.ShowDialog <bool>(window)); }
public async Task <bool> PromptAsync(string title, string content, MessageBoxType type, MessageBoxResult expected, IDialogResourceResolver resolver = null) => (await PromptAsync(title, content, type, resolver)).Equals(expected);
/// <summary> /// Shows a message box, blocking only the window of the specified <paramref name="parent"/> /// </summary> /// <param name="parent">Parent control that triggered the message box</param> /// <param name="text">Text for the body of the message box</param> /// <param name="type">Type of message box</param> public static DialogResult Show(Control parent, string text, MessageBoxType type = MessageBoxType.Information) { return(Show(parent, text, null, type)); }
public static DialogResult Show(Generator generator, Control parent, string text, string caption, MessageBoxButtons buttons, MessageBoxType type = MessageBoxType.Information, MessageBoxDefaultButton defaultButton = MessageBoxDefaultButton.Default) { var mb = generator.Create <IMessageBox>(); mb.Text = text; mb.Caption = caption; mb.Type = type; mb.Buttons = buttons; mb.DefaultButton = defaultButton; return(mb.ShowDialog(parent)); }
public static DialogResult Show(Control parent, string text, string caption, MessageBoxButtons buttons, MessageBoxType type = MessageBoxType.Information, MessageBoxDefaultButton defaultButton = MessageBoxDefaultButton.Default) { return(Show(parent != null ? parent.Generator : Generator.Current, parent, text, caption, buttons, type, defaultButton)); }
public static DialogResult Show(Control parent, string text, string caption, MessageBoxType type = MessageBoxType.Information) { return(Show(parent != null ? parent.Generator : Generator.Current, parent, text, caption, type)); }
public static MessageBoxResult Show(string msg, MessageBoxType type) { return(Show(string.Empty, msg, type)); }
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxType type = MessageBoxType.Information, MessageBoxDefaultButton defaultButton = MessageBoxDefaultButton.Default) { return(Show((Control)null, text, caption, buttons, type, defaultButton)); }
public static async Task <MessageBoxResult> Show(string message, string caption, MessageBoxType type) { var messageBox = new MessageBox(); var viewModel = new MessageBoxViewModel(); viewModel.Caption = caption; viewModel.Message = message; switch (type) { case MessageBoxType.OK: viewModel.IsOkButtonVisible = true; break; case MessageBoxType.YesNo: viewModel.AreYesNoButtonsVisible = true; break; default: break; } messageBox.DataContext = viewModel; await messageBox.ShowDialog(MainWindow.Current); return(viewModel.Result); }
public static DialogResult Show(Generator generator, Control parent, string text, MessageBoxButtons buttons, MessageBoxType type = MessageBoxType.Information, MessageBoxDefaultButton defaultButton = MessageBoxDefaultButton.Default) { return(Show(generator, parent, text, null, buttons, type, defaultButton)); }
public static DialogResult Show(string text, MessageBoxButtons buttons, MessageBoxType type = MessageBoxType.Information) { return(Show((Control)null, text, buttons, type)); }
/// <summary> /// Shows a message box, blocking only the window of the specified <paramref name="parent"/> /// </summary> /// <param name="parent">Parent control that triggered the message box</param> /// <param name="text">Text for the body of the message box</param> /// <param name="type">Type of message box</param> public static DialogResult Show(Control parent, string text, MessageBoxType type = MessageBoxType.Information) { return Show(parent, text, null, type); }
public MessageBoxOptions ShowMessageBox(string message, string title, MessageBoxOptions options, MessageBoxType type) { var vm = IoC.Get <MessageBoxViewModel>(); vm.DisplayName = title; vm.Buttons = options; vm.Content = message; dynamic settings = new ExpandoObject(); settings.ResizeMode = System.Windows.ResizeMode.NoResize; settings.SizeToContent = System.Windows.SizeToContent.WidthAndHeight; settings.TopMost = true; switch (type) { case MessageBoxType.Warning: settings.Foreground = Brushes.DarkOrange; break; case MessageBoxType.Error: settings.Foreground = Brushes.Red; settings.MaxHeight = 500; break; } Execute.OnUIThread(() => { _windowManager.ShowDialog(vm, settings: settings); }); return(vm.ClickedButton); }
/// <summary> /// Call this to show a new MessageBox with a fixed position and rotation /// </summary> /// <param name="text">The text message which should be displayed to the user</param> /// <param name="type">The type of the MessageBox</param> /// <param name="position">The global position where the message box is shown</param> /// <param name="rotation">The global rotation of the message box</param> public static void Show(string text, MessageBoxType type, Vector3 position, Quaternion rotation) { Show(text, type, true, position, rotation); }
/// <summary> /// Shows a message box, blocking input to all windows of the application until closed /// </summary> /// <param name="text">Text for the body of the message box</param> /// <param name="type">Type of message box</param> /// <param name="buttons">Buttons to show on the message box</param> /// <param name="defaultButton">Button to set focus to by default</param> /// <param name="caption">Caption for the title bar or heading of the message box</param> public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxType type = MessageBoxType.Information, MessageBoxDefaultButton defaultButton = MessageBoxDefaultButton.Default) { return Show((Control)null, text, caption, buttons, type, defaultButton); }
/// <summary> /// Shows a message box, blocking only the window of the specified <paramref name="parent"/> /// </summary> /// <param name="parent">Parent control that triggered the message box</param> /// <param name="text">Text for the body of the message box</param> /// <param name="type">Type of message box</param> /// <param name="caption">Caption for the title bar or heading of the message box</param> public static DialogResult Show(Control parent, string text, string caption, MessageBoxType type = MessageBoxType.Information) { return(Show(parent, text, caption, MessageBoxButtons.OK, type)); }
public static extern int MessageBox(IntPtr window, string message, string title, MessageBoxType type);
/// <summary> /// Shows a message box, blocking input to all windows of the application until closed /// </summary> /// <param name="text">Text for the body of the message box</param> /// <param name="caption">Caption for the title bar or heading of the message box</param> /// <param name="type">Type of message box</param> public static DialogResult Show(string text, string caption, MessageBoxType type = MessageBoxType.Information) { return Show(null, text, caption, type); }
/// <summary> /// Shows a message box, blocking only the window of the specified <paramref name="parent"/> /// </summary> /// <param name="parent">Parent control that triggered the message box</param> /// <param name="text">Text for the body of the message box</param> /// <param name="caption">Caption for the title bar or heading of the message box</param> /// <param name="type">Type of message box</param> /// <param name="buttons">Buttons to show on the message box</param> /// <param name="defaultButton">Button to set focus to by default</param> public static DialogResult Show(Control parent, string text, string caption, MessageBoxButtons buttons, MessageBoxType type = MessageBoxType.Information, MessageBoxDefaultButton defaultButton = MessageBoxDefaultButton.Default) { var mb = Platform.Instance.Create <IHandler>(); mb.Text = text; mb.Caption = caption; mb.Type = type; mb.Buttons = buttons; mb.DefaultButton = defaultButton; return(mb.ShowDialog(parent)); }
/// <summary> /// Shows a message box, blocking only the window of the specified <paramref name="parent"/> /// </summary> /// <param name="parent">Parent control that triggered the message box</param> /// <param name="text">Text for the body of the message box</param> /// <param name="type">Type of message box</param> /// <param name="caption">Caption for the title bar or heading of the message box</param> public static DialogResult Show(Control parent, string text, string caption, MessageBoxType type = MessageBoxType.Information) { return Show(parent, text, caption, MessageBoxButtons.OK, type); }
/// <inheritdoc/> public void ShowMessageBox(MessageBoxType type, String title, String message, IUltravioletWindow parent = null) { Contract.EnsureNotDisposed(this, Disposed); }
public static DialogResult Show(Generator generator, Control parent, string text, string caption = null, MessageBoxType type = MessageBoxType.Information) { return Show(generator, parent, text, caption, MessageBoxButtons.OK, type); }
public async Task <MessageBoxResult> PromptAsync(string content, MessageBoxType type = MessageBoxType.YesNo, IDialogResourceResolver resolver = null) => await PromptAsync(string.Empty, content, type, resolver);
public static DialogResult Show(Generator generator, Control parent, string text, string caption, MessageBoxButtons buttons, MessageBoxType type = MessageBoxType.Information, MessageBoxDefaultButton defaultButton = MessageBoxDefaultButton.Default) { var mb = (generator ?? Generator.Current).Create<IHandler>(); mb.Text = text; mb.Caption = caption; mb.Type = type; mb.Buttons = buttons; mb.DefaultButton = defaultButton; return mb.ShowDialog(parent); }
public async Task <MessageBoxResult> PromptAsync(string title, string content, MessageBoxType type = MessageBoxType.YesNo, IDialogResourceResolver resolver = null) => await new MessageBoxEx(title, content, type, resolver).ShowAsync();