Example #1
0
        public void ShowProgressDialog(IControlView view, string caption, string text)
        {
            frm = ProgressDlgFrm.Show(((Control)view).FindForm(), caption, text);

            frm.btnCancelar.Visible = suportsCancellation;
            frm.btnCancelar.Click  += frmProgresso_BtnCancelar_OnClick;
        }
        public static ProgressDlgFrm Show(
            Form owner, string caption, string text, ProgressDlgButtons buttons)
        {
            ProgressDlgFrm frm = new ProgressDlgFrm();

            if (text == null)
            {
                text = MVPCommonMessages.ProgressDlgFrm_Msg001;
            }

            if (caption == null)
            {
                caption = MVPCommonMessages.ProgressDlgFrm_Caption001;
            }

            frm.Text    = text;
            frm.Caption = caption;

            switch (buttons)
            {
            case ProgressDlgButtons.Cancel:
                frm.btnOK.Visible = false;
                break;

            case ProgressDlgButtons.Ok:
                frm.btnCancelar.Visible = false;
                frm.btnOK.Location      = new Point(frm.btnCancelar.Location.X, frm.btnCancelar.Location.Y);
                break;
            }

            frm.Owner     = owner;
            owner.Enabled = false;

            frm.Show((IWin32Window)owner);

            return(frm);
        }