Smart Client Software Factory:创建模态窗体

        protected void ShowViewAsModal<TModalView>(TModalView view)
        {
            WindowSmartPartInfo windowSmartPartInfo = new  WindowSmartPartInfo();
            windowSmartPartInfo.Modal = true;
            _workItem.Workspaces[WorkspaceNames.ModalWindows].Show(view, windowSmartPartInfo);
        }


在弹出模态窗体View中写

        protected override void OnLoad(EventArgs e)
        {
            _presenter.OnViewReady();
            base.OnLoad(e);
            this.ParentForm.StartPosition = FormStartPosition.CenterParent;
            this.ParentForm.MaximizeBox = false;
            this.ParentForm.MinimizeBox = false;
            this.ParentForm.FormBorderStyle = FormBorderStyle.FixedToolWindow;
            this.ParentForm.ShowIcon = false;
        }


this.ParentForm.StartPosition = FormStartPosition.CenterParent; 居于父窗体的正中央

this.ParentForm.MaximizeBox = false;           //禁止调节窗口大小

this.ParentForm.MinimizeBox = false;

你可能感兴趣的:(Smart Client Software Factory:创建模态窗体)