示例#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 = FontUtil.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);
        }