Beispiel #1
0
        // parameters:
        //      nTimeout    超时时间。毫秒数。-1 表示永不超时
        // return:
        //      DialogResult.Retry 表示超时了
        //      DialogResult.OK 表示点了 OK 按钮
        //      DialogResult.Cancel 表示点了右上角的 Close 按钮
        public static DialogResult Show(IWin32Window owner,
                                        string strText,
                                        int nTimeout    = -1,
                                        string strTitle = null)
        {
            AutoCloseMessageBox dlg = new AutoCloseMessageBox();
            Font font = GuiUtil.GetDefaultFont();

            if (font != null)
            {
                dlg.Font = font;
            }

            if (nTimeout != -1)
            {
                dlg.m_nTimeOut = nTimeout;
            }

            if (strTitle != null)
            {
                dlg.Text = strTitle;
            }
            dlg.label_message.Text = strText;
            dlg.StartPosition      = FormStartPosition.CenterScreen;
            return(dlg.ShowDialog(owner));
        }
Beispiel #2
0
        // return:
        //      DialogResult.Retry 表示超时了
        //      DialogResult.OK 表示点了 OK 按钮
        //      DialogResult.Cancel 表示点了右上角的 Close 按钮
        public static DialogResult Show(IWin32Window owner,
            string strText,
            int nTimeout = -1,
            string strTitle = null)
        {
            AutoCloseMessageBox dlg = new AutoCloseMessageBox();
            Font font = GuiUtil.GetDefaultFont();
            if (font != null)
                dlg.Font = font;

            if (nTimeout != -1)
                dlg.m_nTimeOut = nTimeout;

            if (strTitle != null)
                dlg.Text = strTitle;
            dlg.label_message.Text = strText;
            dlg.StartPosition = FormStartPosition.CenterScreen;
            return dlg.ShowDialog(owner);
        }
Beispiel #3
0
 public static void Show(string strText)
 {
     AutoCloseMessageBox.Show(null, strText);
 }