Example #1
0
        public static DialogResult Show(IWin32Window owner, 
			string strText,
			string strCaption,
			MessageBoxButtons buttons,
			MessageBoxDefaultButton defaultButton,
			ref bool bChecked,
            string [] button_texts = null,
            string strCheckBoxText = "")
        {
            MessageDlg dlg = new MessageDlg();
            Font font = GuiUtil.GetDefaultFont();
            if (font != null)
                dlg.Font = font;
            if (string.IsNullOrEmpty(strCheckBoxText) == false)
                dlg.checkBox_noAsk.Text = strCheckBoxText;
            dlg.checkBox_noAsk.Checked = bChecked;
            dlg.buttons = buttons;
            dlg.defaultButton = defaultButton;
            dlg.Message = strText;
            dlg.Text = strCaption;
            dlg.ButtonTexts = button_texts;
            dlg.StartPosition = FormStartPosition.CenterScreen;
            dlg.ShowDialog(owner);

            bChecked = dlg.checkBox_noAsk.Checked;

            return dlg.DialogResult;
        }
 public static DialogResult Show(IWin32Window owner, string text,
     MessageBoxButtons buttons, MessageBoxDefaultButton defaultButton,
     MessageBoxIcon icon)
 {
     return Show(owner, text, "OpenVPN Manager", buttons, icon,
         defaultButton, (MessageBoxOptions) 0);
 }
Example #3
0
 public static void ShowMessage(string message, string title = "NuspecPackager",
     MessageBoxButtons messageBoxButtons = MessageBoxButtons.OK,
     MessageBoxIcon messageBoxIcon = MessageBoxIcon.Warning,
     MessageBoxDefaultButton messageBoxDefaultButton = MessageBoxDefaultButton.Button1)
 {
     Log(String.Format(CultureInfo.CurrentCulture, "{0}: {1}", title, message));
 }
        private KryptonMessageBox(string text, string caption,
                                  MessageBoxButtons buttons, MessageBoxIcon icon,
                                  MessageBoxDefaultButton defaultButton, MessageBoxOptions options,
                                  HelpInfo helpInfo)
        {
            // Store incoming values
            _text = text;
            _caption = caption;
            _buttons = buttons;
            _icon = icon;
            _defaultButton = defaultButton;
            _options = options;
            _helpInfo = helpInfo;

            // Create the form contents
            InitializeComponent();

            // Update contents to match requirements
            UpdateText();
            UpdateIcon();
            UpdateButtons();
            UpdateDefault();
            UpdateHelp();

            // Finally calculate and set form sizing
            UpdateSizing();
        }
Example #5
0
 public static void ShowMessage(string message, string title = "HLSL Tools",
     MessageBoxButtons messageBoxButtons = MessageBoxButtons.OK,
     MessageBoxIcon messageBoxIcon = MessageBoxIcon.Warning,
     MessageBoxDefaultButton messageBoxDefaultButton = MessageBoxDefaultButton.Button1)
 {
     MessageBox.Show(message, title, messageBoxButtons, messageBoxIcon, messageBoxDefaultButton);
 }
 public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defButton, MessageBoxOptions options)
 {
     _owner = owner;
     Initialize();
     return MessageBox.Show(owner, text, caption, buttons, icon,
                            defButton, options);
 }
 /// <include file='doc\MessageBox.uex' path='docs/doc[@for="MessageBox.Show6"]/*' />
 /// <devdoc>
 ///    <para>
 ///       Displays a message box with specified text, caption, and style.
 ///       Makes the dialog RTL if the resources for this dll have been localized to a RTL language.
 ///    </para>
 /// </devdoc>
 public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, 
                                 MessageBoxDefaultButton defaultButton, MessageBoxOptions options) {
     if (RTLAwareMessageBox.IsRTLResources) {
         options |= (MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading);
     }
     return MessageBox.Show(owner, text, caption, buttons, icon, defaultButton, options);
 }
Example #8
0
 ///-------------------------------------------------------------------------------------------------
 /// <summary>   Shows. </summary>
 ///
 /// <remarks>   Justin, 7/11/2015. </remarks>
 ///
 /// <param name="message">              The message. </param>
 /// <param name="result">               The result. </param>
 /// <param name="state">                The state. </param>
 /// <param name="ok">                   The ok. </param>
 /// <param name="messageBoxIcon">       The message box icon. </param>
 /// <param name="button1">              The first button. </param>
 /// <param name="serviceNotification">  The service notification. </param>
 ///-------------------------------------------------------------------------------------------------
 public static void Show(string message, string result, TcpState state, MessageBoxButtons ok, MessageBoxIcon messageBoxIcon,
     MessageBoxDefaultButton button1, MessageBoxOptions serviceNotification)
 {
     MessageBox.Show(String.Format("{0} result: {1}, Tcp State: {2}", message, result, state),
         @"Information", ok,
         messageBoxIcon, button1,
         serviceNotification);
 }
 public static DialogResult Show(IWin32Window owner, string text, 
     string caption, MessageBoxButtons buttons, MessageBoxIcon icon, 
     MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
 {
     
     return MessageBox.Show(owner, text, caption,
         buttons, icon, defaultButton, getDefaultOptions(owner) | options);
 }
Example #10
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// This implementation displays the message in the Console and returns the first
		/// button as dialog result.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public DialogResult Show(IWin32Window owner, string text, string caption,
			MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton,
			MessageBoxOptions options, string helpFilePath, HelpNavigator navigator, object param)
		{
			Console.WriteLine("**** {0}: {1}{3}{2}", caption, text, buttons, Environment.NewLine);

			return TranslateButtons(buttons);
		}
        /// <summary>
        /// Displays a message box in front of the specified object and with the specified
        /// text, buttons, icon, and default button.
        /// </summary>
        /// <param name="text"></param>
        /// <param name="buttons"></param>
        /// <param name="icon"></param>
        /// <param name="defaultButton">One of the System.Windows.Forms.MessageBoxDefaultButton
        /// values the specifies the default button for the message box.</param>
        /// <returns>One of the System.Windows.Forms.DialogResult values.</returns>
        public static DialogResult Show(string text, MessageBoxButtons buttons,
            MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
        {
            string caption = AssemblyHelper.Title;

            return MessageBoxHelper.Show(text, caption, buttons,
                icon, defaultButton, Localization.MessageBoxRtl);
        }
Example #12
0
        /// <summary>
        /// 显示消息框
        /// </summary>
        /// <param name="message">消息文本</param>
        /// <param name="caption">消息框标题</param>
        /// <param name="attachMessage">附加消息</param>
        /// <param name="buttons">按钮组合</param>
        /// <param name="icon">图标</param>
        /// <param name="defaultButton">默认按钮</param>
        public static DialogResult Show(string message, string caption, string attachMessage, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
        {
            if (!Enum.IsDefined(typeof(MessageBoxButtons), buttons)) { throw new InvalidEnumArgumentException(InvalidButtonExString); }
            if (!Enum.IsDefined(typeof(MessageBoxIcon), icon)) { throw new InvalidEnumArgumentException(InvalidIconExString); }
            if (!Enum.IsDefined(typeof(MessageBoxDefaultButton), defaultButton)) { throw new InvalidEnumArgumentException(InvalidDfButtonExString); }

            return ShowCore(message, caption, attachMessage, buttons, icon, defaultButton);
        }
Example #13
0
 public static void ResetVars()
 {
     response = DialogResult.Ignore;
     message = "";
     title = "[BridgeSQL: ERROR]";
     interact = MessageBoxButtons.OKCancel;
     icon = MessageBoxIcon.Error;
     defaultButton = MessageBoxDefaultButton.Button1;
 }
Example #14
0
 /// <summary>
 /// 一般的なダイアログ表示用メソッドです。
 /// </summary>
 public static DialogResult Show(IWin32Window owner, string message,
                                 string title,
                                 MessageBoxButtons buttons,
                                 MessageBoxDefaultButton defaultButton)
 {
     return WinForms.MessageBox.Show(
         owner, message, title, buttons,
         MessageBoxIcon.None, defaultButton);
 }
Example #15
0
 public static DialogResult Show(
     IWin32Window owner, string text, string caption, MessageBoxButtons buttons,
     Bitmap icon, MessageBoxDefaultButton defaultButton, MessageBoxIcon beepType)
 {
     NativeMethods.MessageBeep((int)beepType);
     MessageBoxForm form = new MessageBoxForm();
     return form.ShowMessageBoxDialog(new MessageBoxArgs(
         owner, text, caption, buttons, icon, defaultButton));
 }
Example #16
0
 public static DialogResult Show(String p_text, String p_caption)
 {
     m_text = p_text.ToString();
     m_caption = p_caption.ToString();
     m_icon = MessageBoxIcon.Information;
     m_buttons = MessageBoxButtons.OK;
     m_default = MessageBoxDefaultButton.Button1;
     return ShowForm();
 }
Example #17
0
 public static DialogResult Show(String p_text, String p_caption, MessageBoxButtons p_buttons, MessageBoxIcon p_icon, MessageBoxDefaultButton p_default)
 {
     m_text = p_text.ToString();
     m_caption = p_caption.ToString();
     m_icon = p_icon;
     m_buttons = p_buttons;
     m_default = p_default;
     return ShowForm();
 }
Example #18
0
        //public DialogEventArgs(string text, string caption)
        //    : this(text, caption, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, 0)
        //{
        //}

        public DialogEventArgs(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
        {
            this.text = text;
            this.caption = caption;
            this.buttons = buttons;
            this.icon = icon;
            this.defaultButton = defaultButton;
            this.options = options;
        }
 private static DialogResult ShowWindow(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultbutton)
 {
     MsgWin = new frmBaseMessageForm();
     MsgWin.StartPosition = FormStartPosition.CenterScreen;
    
     DialogResult result = MsgWin.DrawWindow(owner, text, caption, buttons, icon, defaultbutton);
     MsgWin.Dispose();
     return result;
 }
Example #20
0
 public static DialogResult Show(
     string text,
     string caption,
     MessageBoxButtons buttons,
     MessageBoxIcon icon,
     MessageBoxDefaultButton defaultButton )
 {
     return MessageBox.Show( text, caption, buttons, icon, defaultButton );
 }
Example #21
0
 private MessageBoxEx(string text, string title, MessageBoxButtons button, MessageBoxIcon ico, MessageBoxDefaultButton defaultbtn)
     : this()
 {
     this.Text = (title.Trim().Length == 0) ? " " : title;
     this.label1.Text = text;
     this._msgbtn = button;
     this._msgico = ico;
     this._msgdefaultbtn = defaultbtn;
     this.init();
 }
        public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons,
            MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
        {
            if (IsRightToLeft(owner))
            {
                options |= MessageBoxOptions.RtlReading | MessageBoxOptions.RightAlign;
            }

            return MessageBox.Show(owner, text, caption, buttons, icon, defaultButton, options);
        }
 public static bool ConfirmMessage(string messageKey, string complementStr)
 {
     _msgStr = string.Format("{0} {1}?", messageKey, complementStr);
     _msgCaption = Resources.MsgCaptionConfirm;
     _msgButton = MessageBoxButtons.YesNo;
     _msgIcon = MessageBoxIcon.Question;
     _msgDefaultButton = MessageBoxDefaultButton.Button2;
     _dialogResult = MessageBox.Show(_msgStr, _msgCaption, _msgButton, _msgIcon, _msgDefaultButton);
     return (_dialogResult == DialogResult.Yes);
 }
Example #24
0
 /// <summary>
 ///  初始化 <see cref="MessageBoxArgs"/> 类的新实例。
 /// </summary>
 /// <param name="owner">任何实现 <see cref="IWin32Window"/>(表示将拥有模式对话框的顶级窗口)的对象。</param>
 /// <param name="text">需要显示消息文本。</param>
 /// <param name="caption">需要现实的消息标题。</param>
 /// <param name="buttons"><see cref="MessageBoxButtons"/> 值之一。</param>
 /// <param name="icon">需要显示的消息图标。</param>
 /// <param name="defaultButton"><see cref="MessageBoxDefaultButton"/> 值之一。</param>
 public MessageBoxArgs(IWin32Window owner, string text, string caption,
     MessageBoxButtons buttons, Bitmap icon, MessageBoxDefaultButton defaultButton)
 {
     _owner = owner;
     _text = text;
     _caption = caption;
     _buttons = buttons;
     _icon = icon;
     _defaultButton = defaultButton;
 }
Example #25
0
        public CustomMessageBox()
        {
            m_messageBoxButtons = MessageBoxButtons.OK;
            m_messageBoxDefaultButton = MessageBoxDefaultButton.Button1;
            m_messageIcon = MessageIcon.None;
            m_messageBoxOptions = 0;
            m_helpNavigator = HelpNavigator.Topic;
            m_variableDictionary = new Dictionary<string, object>();

            InitializeComponent();
        }
Example #26
0
 public DialogResult ShowMessage(
     string text,
     string caption,
     MessageBoxButtons buttons,
     MessageBoxIcon icon,
     MessageBoxDefaultButton defaultButton,
     MessageBoxOptions options,
     bool displayHelpButton)
 {
     return MessageBox.Show(text, caption, buttons, icon, defaultButton, options, displayHelpButton);
 }
Example #27
0
 public static DialogResult Show(
     string text,
     string caption,
     MessageBoxButtons buttons,
     MessageBoxIcon icon,
     MessageBoxDefaultButton defaultButton,
     MessageBoxOptions options,
     string helpFilePath )
 {
     return MessageBox.Show( text, caption, buttons, icon, defaultButton, options, helpFilePath );
 }
Example #28
0
 public DialogResult ShowMessage(
     string text,
     string caption,
     MessageBoxButtons buttons,
     MessageBoxIcon icon,
     MessageBoxDefaultButton defaultButton,
     MessageBoxOptions options,
     string helpFilePath,
     HelpNavigator navigator)
 {
     return MessageBox.Show(text, caption, buttons, icon, defaultButton, options, helpFilePath, navigator);
 }
Example #29
0
 public static DialogResult Show(bool bStartup,IWin32Window owner, ltext xltext, string caption, MessageBoxButtons buttons, object oIcon, MessageBoxDefaultButton defaultButton)
 {
     Form_Box dlg = new Form_Box(owner, xltext, caption, buttons, oIcon, defaultButton);
     if (bStartup)
     {
         dlg.TopMost = true;
     }
     else
     {
         checkTopMost(owner, dlg);
     }
     return dlg.ShowDialog();
 }
Example #30
0
     public static void ShowMessage(string message, string title = TsWspConstants.TITLE,
 MessageBoxButtons messageBoxButtons = MessageBoxButtons.OK,
 MessageBoxIcon messageBoxIcon = MessageBoxIcon.Warning,
 MessageBoxDefaultButton messageBoxDefaultButton = MessageBoxDefaultButton.Button1)
     {
         if (TsWspSettings.Instance.AllMessagesToOutputWindow)
         {
             Log(String.Format(CultureInfo.CurrentCulture, "{0}: {1}", title, message));
         }
         else
         {
             MessageBox.Show(message, title, messageBoxButtons, messageBoxIcon, messageBoxDefaultButton);
         }
     }
Example #31
0
        // Pop up a message box and ask the user for a response.
        public static MsgBoxResult MsgBox
            (Object Prompt,
            [Optional][DefaultValue(MsgBoxStyle.OKOnly)]
            MsgBoxStyle Buttons,
            [Optional][DefaultValue(null)] Object Title)
        {
            // Consult the host to find the message box's parent window.
            IVbHost      host;
            IWin32Window parent;

            host = HostServices.VBHost;
            if (host != null)
            {
                parent = host.GetParentWindow();
            }
            else
            {
                parent = null;
            }

            // Convert the message box style into its WinForms equivalent.
            MessageBoxButtons       buttons = MessageBoxButtons.OK;
            MessageBoxIcon          icon    = MessageBoxIcon.None;
            MessageBoxDefaultButton def     = MessageBoxDefaultButton.Button1;
            MessageBoxOptions       options = (MessageBoxOptions)0;

            switch (Buttons & (MsgBoxStyle)0x0F)
            {
            case MsgBoxStyle.OKCancel:
                buttons = MessageBoxButtons.OKCancel; break;

            case MsgBoxStyle.AbortRetryIgnore:
                buttons = MessageBoxButtons.AbortRetryIgnore; break;

            case MsgBoxStyle.YesNoCancel:
                buttons = MessageBoxButtons.YesNoCancel; break;

            case MsgBoxStyle.YesNo:
                buttons = MessageBoxButtons.YesNo; break;

            case MsgBoxStyle.RetryCancel:
                buttons = MessageBoxButtons.RetryCancel; break;
            }
            if ((Buttons & MsgBoxStyle.Critical) != 0)
            {
                icon = MessageBoxIcon.Hand;
            }
            else if ((Buttons & MsgBoxStyle.Question) != 0)
            {
                icon = MessageBoxIcon.Question;
            }
            else if ((Buttons & MsgBoxStyle.Exclamation) != 0)
            {
                icon = MessageBoxIcon.Exclamation;
            }
            else if ((Buttons & MsgBoxStyle.Information) != 0)
            {
                icon = MessageBoxIcon.Asterisk;
            }
            if ((Buttons & MsgBoxStyle.DefaultButton2) != 0)
            {
                def = MessageBoxDefaultButton.Button2;
            }
            else if ((Buttons & MsgBoxStyle.DefaultButton3) != 0)
            {
                def = MessageBoxDefaultButton.Button3;
            }
            if ((Buttons & MsgBoxStyle.MsgBoxRight) != 0)
            {
                options = MessageBoxOptions.RightAlign;
            }
            if ((Buttons & MsgBoxStyle.MsgBoxRtlReading) != 0)
            {
                options = MessageBoxOptions.RtlReading;
            }

            // Pop up the message box and get the WinForms result.
            DialogResult result;

            result = MessageBox.Show
                         (parent, StringType.FromObject(Prompt),
                         StringType.FromObject(Title),
                         buttons, icon, def, options);
            return((MsgBoxResult)result);
        }
Example #32
0
 public static DialogResult Question(string text, string caption, MessageBoxButtons buttons, MessageBoxDefaultButton defButton)
 {
     return(DevExpress.XtraEditors.XtraMessageBox.Show(text, caption, buttons, MessageBoxIcon.Question, defButton));
 }
Example #33
0
        public MessageBoxFormNative(IWin32Window owner, string text, string caption,
                                    MessageBoxButtons buttons, MessageBoxIcon icon,
                                    bool displayHelpButton)
        {
            show_help = displayHelpButton;

            switch (icon)
            {
            case MessageBoxIcon.None: {
                icon_image = null;
                alert_type = AlertType.Default;
                break;
            }

            case MessageBoxIcon.Error: {                        // Same as MessageBoxIcon.Hand and MessageBoxIcon.Stop
                icon_image = SystemIcons.Error;
                alert_type = AlertType.Error;
                break;
            }

            case MessageBoxIcon.Question: {
                icon_image = SystemIcons.Question;
                alert_type = AlertType.Question;
                break;
            }

            case MessageBoxIcon.Asterisk: {                     // Same as MessageBoxIcon.Information
                icon_image = SystemIcons.Information;
                alert_type = AlertType.Information;
                break;
            }

            case MessageBoxIcon.Warning: {                      // Same as MessageBoxIcon.Exclamation:
                icon_image = SystemIcons.Warning;
                alert_type = AlertType.Warning;
                break;
            }
            }

            msgbox_text    = text;
            msgbox_buttons = buttons;
            msgbox_default = MessageBoxDefaultButton.Button1;

            if (owner != null)
            {
                Owner = Control.FromHandle(owner.Handle).FindForm();
            }
            else
            {
                if (Application.MWFThread.Current.Context != null)
                {
                    Owner = Application.MWFThread.Current.Context.MainForm;
                }
            }
            this.Text            = caption;
            this.ControlBox      = true;
            this.MinimizeBox     = false;
            this.MaximizeBox     = false;
            this.ShowInTaskbar   = (Owner == null);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
        }
Example #34
0
        private static DialogResult ShowCore(IWin32Window owner, string text, string caption,
                                             MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton,
                                             MessageBoxOptions options, HelpInfo hpi)
        {
            DialogResult result = DialogResult.None;

            try
            {
                PushHelpInfo(hpi);
                result = ShowCore(owner, text, caption, buttons, icon, defaultButton, options, true);
            }
            finally
            {
                PopHelpInfo();
            }

            return(result);
        }
Example #35
0
 public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon,
                                 MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
 {
     return(ShowCore(null, text, caption, buttons, icon, defaultButton, options, false));
 }
Example #36
0
 public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defButton, MessageBoxOptions options, uint uTimeout)
 {
     Setup(caption, uTimeout);
     return(MessageBox.Show(owner, text, caption, buttons, icon, defButton, options));
 }
Example #37
0
        private static MB GetMessageBoxStyle(IWin32Window owner, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, bool showHelp)
        {
            SourceGenerated.EnumValidator.Validate(buttons, nameof(buttons));
            SourceGenerated.EnumValidator.Validate(icon, nameof(icon));
            SourceGenerated.EnumValidator.Validate(defaultButton, nameof(defaultButton));

            // options intentionally not verified because we don't expose all the options Win32 supports.

            if (!SystemInformation.UserInteractive && (options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) == 0)
            {
                throw new InvalidOperationException(SR.CantShowModalOnNonInteractive);
            }

            if (owner != null && (options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) != 0)
            {
                throw new ArgumentException(SR.CantShowMBServiceWithOwner, nameof(options));
            }

            if (showHelp && (options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) != 0)
            {
                throw new ArgumentException(SR.CantShowMBServiceWithHelp, nameof(options));
            }

            MB style = (showHelp) ? MB.HELP : 0;

            style |= (MB)buttons | (MB)icon | (MB)defaultButton | (MB)options;
            return(style);
        }
Example #38
0
 public static DialogResult Show(string pstrMessage, MessageBoxButtons pobjButton, MessageBoxIcon pobjIcon, MessageBoxDefaultButton pobjDefaultButton)
 {
     return(MessageBox.Show(pstrMessage, Constants.APPLICATION_NAME, pobjButton, pobjIcon, pobjDefaultButton));
 }
Example #39
0
        public static DialogResult Show(int pintMessageCode, MessageBoxButtons pobjButton, MessageBoxIcon pobjIcon, MessageBoxDefaultButton pobjDefaultButton)
        {
            try
            {
                string strMessage = ErrorMessageBO.GetErrorMessage(pintMessageCode);
                return(MessageBox.Show(strMessage, Constants.APPLICATION_NAME, pobjButton, pobjIcon, pobjDefaultButton));
            }
            catch
            {
                // log message.
                try
                {
                    Logger.LogMessage(MESSAGE_SYSTEM_ERROR + SPACE + pintMessageCode, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                }

                return(MessageBox.Show(MESSAGE_SYSTEM_ERROR, Constants.APPLICATION_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error));
            }
        }
Example #40
0
        public void InitButton(MessageBoxButtons messageBoxButtons, MessageBoxDefaultButton messageBoxDefaultButton = MessageBoxDefaultButton.Button3)
        {
            switch (messageBoxButtons)
            {
            case MessageBoxButtons.OK:
                btnLeft.Visible   = false;
                btnMidlle.Visible = false;
                btnRight.Caption  = STR_BUTTON_TEXT_OK;
                break;

            case MessageBoxButtons.OKCancel:
                btnLeft.Visible   = false;
                btnMidlle.Caption = STR_BUTTON_TEXT_OK;
                btnRight.Caption  = STR_BUTTON_TEXT_CANCEL;
                break;

            case MessageBoxButtons.AbortRetryIgnore:
                btnLeft.Caption   = STR_BUTTON_TEXT_ABORT;
                btnMidlle.Caption = STR_BUTTON_TEXT_RETRY;
                btnRight.Caption  = STR_BUTTON_TEXT_IGNORE;

                break;

            case MessageBoxButtons.YesNoCancel:
                btnLeft.Caption   = STR_BUTTON_TEXT_YES;
                btnMidlle.Caption = STR_BUTTON_TEXT_NO;
                btnRight.Caption  = STR_BUTTON_TEXT_CANCEL;
                break;

            case MessageBoxButtons.YesNo:
                btnLeft.Visible   = false;
                btnMidlle.Caption = STR_BUTTON_TEXT_YES;
                btnRight.Caption  = STR_BUTTON_TEXT_NO;
                break;

            case MessageBoxButtons.RetryCancel:
                btnLeft.Visible   = false;
                btnMidlle.Caption = STR_BUTTON_TEXT_RETRY;
                btnRight.Caption  = STR_BUTTON_TEXT_CANCEL;
                break;
            }


            switch (messageBoxDefaultButton)
            {
            case MessageBoxDefaultButton.Button1:
                if (btnLeft.Visible)
                {
                    this.AcceptButton = this.btnLeft;
                }
                else if (btnMidlle.Visible)
                {
                    this.AcceptButton = this.btnMidlle;
                }
                else
                {
                    this.AcceptButton = this.btnRight;
                }
                break;

            case MessageBoxDefaultButton.Button2:
                if (btnMidlle.Visible)
                {
                    this.AcceptButton = this.btnMidlle;
                }
                else
                {
                    this.AcceptButton = this.btnRight;
                }
                break;

            case MessageBoxDefaultButton.Button3:
                this.AcceptButton = this.btnRight;
                break;
            }
        }
Example #41
0
        public static DialogResult Show(int pintMessageCode, MessageBoxButtons pobjButton, MessageBoxIcon pobjIcon, MessageBoxDefaultButton pobjDefaultButton, params string[] pstrParams)
        {
            const string OLD_CHAR = "@";

            try
            {
                string strMessage = ErrorMessageBO.GetErrorMessage(pintMessageCode);
                for (int i = 0; i < pstrParams.Length; i++)
                {
                    int intIndex = strMessage.IndexOf(OLD_CHAR);
                    strMessage = strMessage.Remove(intIndex, 1);
                    strMessage = strMessage.Insert(intIndex, pstrParams[i]);
                }
                return(MessageBox.Show(strMessage, Constants.APPLICATION_NAME, pobjButton, pobjIcon, pobjDefaultButton));
            }
            catch
            {
                // log message.
                try
                {
                    Logger.LogMessage(MESSAGE_SYSTEM_ERROR + SPACE + pintMessageCode, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                }

                return(MessageBox.Show(MESSAGE_SYSTEM_ERROR, Constants.APPLICATION_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error));
            }
        }
        /// <summary>
        /// Shows a metro-styles message notification into the specified owner window.
        /// </summary>
        /// <param name="owner"></param>
        /// <param name="message"></param>
        /// <param name="title"></param>
        /// <param name="buttons"></param>
        /// <param name="icon"></param>
        /// <param name="defaultbutton"></param>
        /// <returns></returns>
        public static DialogResult Show(IWin32Window owner, String message, String title, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultbutton)
        {
            DialogResult _result = DialogResult.None;

            if (owner != null)
            {
                Form _owner = (Form)owner;

                //int _minWidth = 500;
                //int _minHeight = 350;

                //if (_owner.Size.Width < _minWidth ||
                //    _owner.Size.Height < _minHeight)
                //{
                //    if (_owner.Size.Width < _minWidth && _owner.Size.Height < _minHeight) {
                //            _owner.Size = new Size(_minWidth, _minHeight);
                //    }
                //    else
                //    {
                //        if (_owner.Size.Width < _minWidth) _owner.Size = new Size(_minWidth, _owner.Size.Height);
                //        else _owner.Size = new Size(_owner.Size.Width, _minHeight);
                //    }

                //    int x = Convert.ToInt32(Math.Ceiling((decimal)(Screen.PrimaryScreen.WorkingArea.Size.Width / 2) - (_owner.Size.Width / 2)));
                //    int y = Convert.ToInt32(Math.Ceiling((decimal)(Screen.PrimaryScreen.WorkingArea.Size.Height / 2) - (_owner.Size.Height / 2)));
                //    _owner.Location = new Point(x, y);
                //}

                switch (icon)
                {
                case MessageBoxIcon.Error:
                    SystemSounds.Hand.Play(); break;

                case MessageBoxIcon.Exclamation:
                    SystemSounds.Exclamation.Play(); break;

                case MessageBoxIcon.Question:
                    SystemSounds.Beep.Play(); break;

                default:
                    SystemSounds.Asterisk.Play(); break;
                }

                MetroMessageBoxControl _control = new MetroMessageBoxControl();
                _control.BackColor                = _owner.BackColor;
                _control.Properties.Buttons       = buttons;
                _control.Properties.DefaultButton = defaultbutton;
                _control.Properties.Icon          = icon;
                _control.Properties.Message       = message;
                _control.Properties.Title         = title;
                _control.Padding       = new Padding(0, 0, 0, 0);
                _control.ControlBox    = false;
                _control.ShowInTaskbar = false;



                //_owner.Controls.Add(_control);
                //if (_owner is IMetroForm)
                //{
                //    //if (((MetroForm)_owner).DisplayHeader)
                //    //{
                //    //    _offset += 30;
                //    //}
                //    _control.Theme = ((MetroForm)_owner).Theme;
                //    _control.Style = ((MetroForm)_owner).Style;
                //}

                _control.Size     = new Size(_owner.Size.Width, _control.Height);
                _control.Location = new Point(_owner.Location.X, _owner.Location.Y + (_owner.Height - _control.Height) / 2);
                _control.ArrangeApperance();
                int _overlaySizes = Convert.ToInt32(Math.Floor(_control.Size.Height * 0.28));
                //_control.OverlayPanelTop.Size = new Size(_control.Size.Width, _overlaySizes - 30);
                //_control.OverlayPanelBottom.Size = new Size(_control.Size.Width, _overlaySizes);

                _control.ShowDialog();
                _control.BringToFront();
                _control.SetDefaultButton();

                Action <MetroMessageBoxControl> _delegate = new Action <MetroMessageBoxControl>(ModalState);
                IAsyncResult _asyncresult = _delegate.BeginInvoke(_control, null, _delegate);
                bool         _cancelled   = false;

                try
                {
                    while (!_asyncresult.IsCompleted)
                    {
                        Thread.Sleep(1); Application.DoEvents();
                    }
                }
                catch
                {
                    _cancelled = true;

                    if (!_asyncresult.IsCompleted)
                    {
                        try { _asyncresult = null; }
                        catch { }
                    }

                    _delegate = null;
                }

                if (!_cancelled)
                {
                    _result = _control.Result;
                    //_owner.Controls.Remove(_control);
                    _control.Dispose(); _control = null;
                }
            }

            return(_result);
        }
Example #43
0
 public static DialogResult Show(Control owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defButton, MessageBoxOptions options)
 {
     _owner = owner;
     Initialize();
     if (owner.InvokeRequired)
     {
         owner.Invoke(new InitializeEventHandler(Initialize));
         return((DialogResult)owner.Invoke(new MesssageBoxEventHandlerCaptionButtonsIconDefbuttonOptions(MessageBox.Show), new object[] { owner, text, caption, buttons, icon, defButton, options }));
     }
     else
     {
         Initialize();
         return(MessageBox.Show(owner, text, caption, buttons, icon, defButton, options));
     }
 }
Example #44
0
 public static DialogResult Error(string message, Exception e, MessageBoxButtons buttons, MessageBoxDefaultButton defaultButton)
 {
     if (setting != null && setting.ReportException)
     {
         message += "\n\nエラー内容:\n" + e.Message;
     }
     return(Error(message, buttons, defaultButton));
 }
Example #45
0
        public static DialogResult ErroMessage(string MessageDescription, string MoudleName, MessageBoxButtons MsgButton, MessageBoxIcon Icon, MessageBoxDefaultButton DefaultButton)
        {
            string Catpion       = "System Message";
            string MessageString = MessageDescription + "\n\n" + MoudleName;

            return(MessageBox.Show(MessageString, Catpion, MsgButton, Icon, DefaultButton));
        }
 /// <summary>
 /// Shows the exception.
 /// </summary>
 /// <param name="exceptionMessage">The exception message.</param>
 /// <param name="useKryptonMessageBox">if set to <c>true</c> [use krypton message box].</param>
 /// <param name="useExtendedKryptonMessageBox">if set to <c>true</c> [use extended krypton message box].</param>
 /// <param name="useWin32MessageBox">if set to <c>true</c> [use win32 message box].</param>
 /// <param name="useConsole">if set to <c>true</c> [use console].</param>
 /// <param name="useToolStripLabel">if set to <c>true</c> [use tool strip label].</param>
 /// <param name="toolStripLabel">The tool strip label.</param>
 /// <param name="args">The arguments.</param>
 /// <param name="caption">The caption.</param>
 /// <param name="buttons">The buttons.</param>
 /// <param name="defaultButton">The default button.</param>
 /// <param name="icon">The icon.</param>
 /// <param name="options">The options.</param>
 public void ShowException(string exceptionMessage, bool useKryptonMessageBox = false, bool useExtendedKryptonMessageBox = false, bool useWin32MessageBox = false, bool useConsole = false, bool useToolStripLabel = false, ToolStripLabel toolStripLabel = null, object args = null, string caption = "Exception Caught", MessageBoxButtons buttons = MessageBoxButtons.OK, MessageBoxDefaultButton defaultButton = MessageBoxDefaultButton.Button3, MessageBoxIcon icon = MessageBoxIcon.Exclamation, MessageBoxOptions options = MessageBoxOptions.DefaultDesktopOnly)
 {
     if (useKryptonMessageBox)
     {
         KryptonMessageBox.Show(exceptionMessage, caption, buttons, icon, defaultButton, options);
     }
     else if (useExtendedKryptonMessageBox)
     {
     }
     else if (useWin32MessageBox)
     {
         MessageBox.Show(exceptionMessage, caption, buttons, icon, defaultButton, options);
     }
     else if (useConsole)
     {
         Console.WriteLine($"[ { DateTime.Now.ToString() } ]: { exceptionMessage }");
     }
 }
Example #47
0
        private static DialogResult ShowCore(
            IWin32Window owner,
            string text,
            string caption,
            MessageBoxButtons buttons,
            Bitmap icon,
            MessageBoxDefaultButton defaultButton,
            RightToLeft rightToLeft,
            string detailsText)
        {
            if (RadMessageBox.Instance.Visible)
            {
                RadMessageBox.Instance.Dispose();
            }
            if (RadMessageBox.Instance == null || RadMessageBox.Instance.IsDisposed)
            {
                RadMessageBox.radMessageBoxForm = new RadMessageBoxForm();
            }
            RadMessageBox.Instance.DialogResult  = DialogResult.Cancel;
            RadMessageBox.Instance.RightToLeft   = rightToLeft;
            RadMessageBox.Instance.DetailsText   = detailsText;
            RadMessageBox.Instance.MessageText   = text;
            RadMessageBox.Instance.StartPosition = FormStartPosition.CenterParent;
            RadMessageBox.Instance.Owner         = (Form)null;
            Control bottom = (Control)null;

            if (owner != null)
            {
                bottom = Control.FromHandle(owner.Handle);
                if (bottom != null)
                {
                    RadMessageBox.Instance.Owner = bottom.FindForm();
                }
            }
            else
            {
                RadMessageBox.Instance.StartPosition = FormStartPosition.CenterScreen;
            }
            if (RadMessageBox.Instance.Owner != null)
            {
                RadMessageBox.Instance.TopMost = RadMessageBox.Instance.Owner.TopMost;
            }
            if (!string.IsNullOrEmpty(caption))
            {
                RadMessageBox.Instance.Text = caption;
            }
            else
            {
                RadMessageBox.Instance.Text = string.Empty;
            }
            RadMessageBox.Instance.MessageIcon          = icon;
            RadMessageBox.Instance.ButtonsConfiguration = buttons;
            RadMessageBox.Instance.DefaultButton        = defaultButton;
            bool flag = RadMessageBox.CheckParentingCycle(bottom, (Control)RadMessageBox.Instance);

            if (RadMessageBox.Instance.Owner != null)
            {
                if (!flag)
                {
                    try
                    {
                        int num = (int)RadMessageBox.Instance.ShowDialog((IWin32Window)RadMessageBox.Instance.Owner);
                        goto label_18;
                    }
                    catch (ArgumentException ex)
                    {
                        int num = (int)RadMessageBox.Instance.ShowDialog();
                        goto label_18;
                    }
                }
            }
            int num1 = (int)RadMessageBox.Instance.ShowDialog();

label_18:
            DialogResult dialogResult = DialogResult.OK;

            if (buttons != MessageBoxButtons.OK)
            {
                dialogResult = RadMessageBox.Instance.DialogResult;
            }
            return(dialogResult);
        }
Example #48
0
            /// <summary>
            ///     Shows the specified message box.
            /// </summary>
            /// <param name="owner">The owner.</param>
            /// <param name="text">The text.</param>
            /// <param name="caption">The caption.</param>
            /// <param name="buttons">The buttons.</param>
            /// <param name="icon">The icon.</param>
            /// <param name="defaultButton">The default button.</param>
            /// <returns>The dialog result.</returns>
            public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
            {
                //Create a new instance of the FlexibleMessageBox form
                var flexibleMessageBoxForm = new FlexibleMessageBoxForm();

                flexibleMessageBoxForm.ShowInTaskbar = false;

                //Bind the caption and the message text
                flexibleMessageBoxForm.CaptionText = caption;
                flexibleMessageBoxForm.MessageText = text;
                flexibleMessageBoxForm.FlexibleMessageBoxFormBindingSource.DataSource = flexibleMessageBoxForm;

                //Set the buttons visibilities and texts. Also set a default button.
                SetDialogButtons(flexibleMessageBoxForm, buttons, defaultButton);

                //Set the dialogs icon. When no icon is used: Correct placement and width of rich text box.
                SetDialogIcon(flexibleMessageBoxForm, icon);

                //Set the font for all controls
                flexibleMessageBoxForm.Font = FONT;
                flexibleMessageBoxForm.richTextBoxMessage.Font = FONT;

                //Calculate the dialogs start size (Try to auto-size width to show longest text row). Also set the maximum dialog size.
                SetDialogSizes(flexibleMessageBoxForm, text);

                //Set the dialogs start position when given. Otherwise center the dialog on the current screen.
                SetDialogStartPosition(flexibleMessageBoxForm, owner);

                //Show the dialog
                return(flexibleMessageBoxForm.ShowDialog(owner));
            }
Example #49
0
 public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defButton, uint uTimeout)
 {
     Setup(caption, uTimeout);
     return(MessageBox.Show(text, caption, buttons, icon, defButton));
 }
Example #50
0
            /// <summary>
            ///     Set dialog buttons visibilities and texts.
            ///     Also set a default button.
            /// </summary>
            /// <param name="flexibleMessageBoxForm">The FlexibleMessageBox dialog.</param>
            /// <param name="buttons">The buttons.</param>
            /// <param name="defaultButton">The default button.</param>
            private static void SetDialogButtons(FlexibleMessageBoxForm flexibleMessageBoxForm, MessageBoxButtons buttons, MessageBoxDefaultButton defaultButton)
            {
                //Set the buttons visibilities and texts
                switch (buttons)
                {
                case MessageBoxButtons.AbortRetryIgnore:
                    flexibleMessageBoxForm._visibleButtonsCount = 3;

                    flexibleMessageBoxForm.button1.Visible      = true;
                    flexibleMessageBoxForm.button1.Text         = flexibleMessageBoxForm.GetButtonText(BUTTON_TEXT.ABORT);
                    flexibleMessageBoxForm.button1.DialogResult = DialogResult.Abort;

                    flexibleMessageBoxForm.button2.Visible      = true;
                    flexibleMessageBoxForm.button2.Text         = flexibleMessageBoxForm.GetButtonText(BUTTON_TEXT.RETRY);
                    flexibleMessageBoxForm.button2.DialogResult = DialogResult.Retry;

                    flexibleMessageBoxForm.button3.Visible      = true;
                    flexibleMessageBoxForm.button3.Text         = flexibleMessageBoxForm.GetButtonText(BUTTON_TEXT.IGNORE);
                    flexibleMessageBoxForm.button3.DialogResult = DialogResult.Ignore;

                    flexibleMessageBoxForm.ControlBox = false;
                    break;

                case MessageBoxButtons.OKCancel:
                    flexibleMessageBoxForm._visibleButtonsCount = 2;

                    flexibleMessageBoxForm.button2.Visible      = true;
                    flexibleMessageBoxForm.button2.Text         = flexibleMessageBoxForm.GetButtonText(BUTTON_TEXT.OK);
                    flexibleMessageBoxForm.button2.DialogResult = DialogResult.OK;

                    flexibleMessageBoxForm.button3.Visible      = true;
                    flexibleMessageBoxForm.button3.Text         = flexibleMessageBoxForm.GetButtonText(BUTTON_TEXT.CANCEL);
                    flexibleMessageBoxForm.button3.DialogResult = DialogResult.Cancel;

                    flexibleMessageBoxForm.CancelButton = flexibleMessageBoxForm.button3;
                    break;

                case MessageBoxButtons.RetryCancel:
                    flexibleMessageBoxForm._visibleButtonsCount = 2;

                    flexibleMessageBoxForm.button2.Visible      = true;
                    flexibleMessageBoxForm.button2.Text         = flexibleMessageBoxForm.GetButtonText(BUTTON_TEXT.RETRY);
                    flexibleMessageBoxForm.button2.DialogResult = DialogResult.Retry;

                    flexibleMessageBoxForm.button3.Visible      = true;
                    flexibleMessageBoxForm.button3.Text         = flexibleMessageBoxForm.GetButtonText(BUTTON_TEXT.CANCEL);
                    flexibleMessageBoxForm.button3.DialogResult = DialogResult.Cancel;

                    flexibleMessageBoxForm.CancelButton = flexibleMessageBoxForm.button3;
                    break;

                case MessageBoxButtons.YesNo:
                    flexibleMessageBoxForm._visibleButtonsCount = 2;

                    flexibleMessageBoxForm.button2.Visible      = true;
                    flexibleMessageBoxForm.button2.Text         = flexibleMessageBoxForm.GetButtonText(BUTTON_TEXT.YES);
                    flexibleMessageBoxForm.button2.DialogResult = DialogResult.Yes;

                    flexibleMessageBoxForm.button3.Visible      = true;
                    flexibleMessageBoxForm.button3.Text         = flexibleMessageBoxForm.GetButtonText(BUTTON_TEXT.NO);
                    flexibleMessageBoxForm.button3.DialogResult = DialogResult.No;

                    flexibleMessageBoxForm.ControlBox = false;
                    break;

                case MessageBoxButtons.YesNoCancel:
                    flexibleMessageBoxForm._visibleButtonsCount = 3;

                    flexibleMessageBoxForm.button1.Visible      = true;
                    flexibleMessageBoxForm.button1.Text         = flexibleMessageBoxForm.GetButtonText(BUTTON_TEXT.YES);
                    flexibleMessageBoxForm.button1.DialogResult = DialogResult.Yes;

                    flexibleMessageBoxForm.button2.Visible      = true;
                    flexibleMessageBoxForm.button2.Text         = flexibleMessageBoxForm.GetButtonText(BUTTON_TEXT.NO);
                    flexibleMessageBoxForm.button2.DialogResult = DialogResult.No;

                    flexibleMessageBoxForm.button3.Visible      = true;
                    flexibleMessageBoxForm.button3.Text         = flexibleMessageBoxForm.GetButtonText(BUTTON_TEXT.CANCEL);
                    flexibleMessageBoxForm.button3.DialogResult = DialogResult.Cancel;

                    flexibleMessageBoxForm.CancelButton = flexibleMessageBoxForm.button3;
                    break;

                case MessageBoxButtons.OK:
                default:
                    flexibleMessageBoxForm._visibleButtonsCount = 1;
                    flexibleMessageBoxForm.button3.Visible      = true;
                    flexibleMessageBoxForm.button3.Text         = flexibleMessageBoxForm.GetButtonText(BUTTON_TEXT.OK);
                    flexibleMessageBoxForm.button3.DialogResult = DialogResult.OK;

                    flexibleMessageBoxForm.CancelButton = flexibleMessageBoxForm.button3;
                    break;
                }

                //Set default button (used in FlexibleMessageBoxForm_Shown)
                flexibleMessageBoxForm._defaultButton = defaultButton;
            }
Example #51
0
        private static DialogResult ShowCore(IWin32Window owner, string text, string caption,
                                             MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton,
                                             MessageBoxOptions options, bool showHelp)
        {
            MB style = GetMessageBoxStyle(owner, buttons, icon, defaultButton, options, showHelp);

            IntPtr handle = IntPtr.Zero;

            if (showHelp || ((options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) == 0))
            {
                if (owner is null)
                {
                    handle = GetActiveWindow();
                }
                else
                {
                    handle = Control.GetSafeHandle(owner);
                }
            }

            IntPtr userCookie = IntPtr.Zero;

            if (Application.UseVisualStyles)
            {
                // CLR4.0 or later, shell32.dll needs to be loaded explicitly.
                if (Kernel32.GetModuleHandleW(Libraries.Shell32) == IntPtr.Zero)
                {
                    if (Kernel32.LoadLibraryFromSystemPathIfAvailable(Libraries.Shell32) == IntPtr.Zero)
                    {
                        int lastWin32Error = Marshal.GetLastWin32Error();
                        throw new Win32Exception(lastWin32Error, string.Format(SR.LoadDLLError, Libraries.Shell32));
                    }
                }

                // Activate theming scope to get theming for controls at design time and when hosted in browser.
                // NOTE: If a theming context is already active, this call is very fast, so shouldn't be a perf issue.
                userCookie = ThemingScope.Activate(Application.UseVisualStyles);
            }

            Application.BeginModalMessageLoop();
            try
            {
                return((DialogResult)MessageBoxW(new HandleRef(owner, handle), text, caption, style));
            }
            finally
            {
                Application.EndModalMessageLoop();
                ThemingScope.Deactivate(userCookie);

                // Right after the dialog box is closed, Windows sends WM_SETFOCUS back to the previously active control
                // but since we have disabled this thread main window the message is lost. So we have to send it again after
                // we enable the main window.
                User32.SendMessageW(new HandleRef(owner, handle), User32.WM.SETFOCUS);
            }
        }
Example #52
0
 /// <summary>
 ///     Shows the specified message box.
 /// </summary>
 /// <param name="owner">The owner.</param>
 /// <param name="text">The text.</param>
 /// <param name="caption">The caption.</param>
 /// <param name="buttons">The buttons.</param>
 /// <param name="icon">The icon.</param>
 /// <param name="defaultButton">The default button.</param>
 /// <returns>The dialog result.</returns>
 public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
 {
     return(FlexibleMessageBoxForm.Show(owner, text, caption, buttons, icon, defaultButton));
 }
Example #53
0
 public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon,
                                 MessageBoxDefaultButton defaultButton)
 {
     return(ShowCore(owner, text, caption, buttons, icon, defaultButton, 0, false));
 }
Example #54
0
 public void ErroMessage(string MessageDescription, string MoudleName, MessageBoxIcon Icon, MessageBoxDefaultButton DefaultButton)
 {
     CommDBFunction.ErroMessage(MessageDescription, MoudleName, Icon, DefaultButton);
 }
Example #55
0
 // Methods
 public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
 {
     if (IsRTLResources)
     {
         options |= MessageBoxOptions.RtlReading | MessageBoxOptions.RightAlign;
     }
     return(MessageBox.Show(owner, text, caption, buttons, icon, defaultButton, options));
 }
Example #56
0
 public DialogResult ErroMessage(string MessageDescription, string MoudleName, MessageBoxButtons MsgButton, MessageBoxIcon Icon, MessageBoxDefaultButton DefaultButton)
 {
     return(CommDBFunction.ErroMessage(MessageDescription, MoudleName, MsgButton, Icon, DefaultButton));
 }
Example #57
0
 public static DialogResult Information(string message, string caption, MessageBoxButtons buttons, MessageBoxDefaultButton defButton)
 {
     return(DevExpress.XtraEditors.XtraMessageBox.Show(message, caption, buttons, MessageBoxIcon.Information, defButton));
 }
Example #58
0
        public static void ErroMessage(string MessageDescription, string MoudleName, MessageBoxIcon Icon, MessageBoxDefaultButton DefaultButton)
        {
            string            Catpion       = "System Message";
            string            MessageString = MessageDescription + "\n\n" + MoudleName;
            MessageBoxButtons MsgButton     = MessageBoxButtons.OK;

            MessageBox.Show(MessageString, Catpion, MsgButton, Icon, DefaultButton);
        }
Example #59
0
 public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defButton, MessageBoxOptions options)
 {
     Initialize();
     return(MessageBox.Show(text, caption, buttons, icon, defButton, options));
 }
Example #60
0
 /// <summary>
 /// Displays a message box in front of the specified object and with the specified text.
 /// </summary>
 /// <param name="owner">An implementation of IWin32Window that will own the modal dialog box.</param>
 /// <param name="text">The text to display in the message box.</param>
 /// <param name="buttons">One of the MessageBoxButtons values that specifies which buttons to display in the message box.</param>
 /// <param name="icon">One of the MessageBoxIcon values that specifies which icon to display in the message box.</param>
 /// <param name="defaultButton">One of the MessageBoxDefaultButton values that specifies the default button for the message box.</param>
 public static DialogResult ShowDialog(IWin32Window owner, string text, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
 {
     lock (_syncRoot) {
         return(ShowDialog(owner, text, Resources.DefaultCaption, buttons, icon, defaultButton));
     }
 }