/// <summary> /// open new form in four directions and mather form will be froozed /// 打开在4个方向新的窗体,母窗体将被冻结 /// /// </summary> /// <param name="SonForm">the form to be showed</param> /// <param name="d">direction </param> public void OpenNewForm(SmartForm SonForm, Direction d) { SonForm.direc = d; this.EventLocationChanged += SonForm.form_EventLocationChanged; TellRightPoint(); Form Son = (Form)SonForm; Son.Owner = this; this.Enabled = false; Son.Show(); }
/// <summary> /// open new form which will return dialogresult in four directions and mather form will be froozed /// 打开在4个方向新的窗体,这个窗体将会返回窗体结果,母窗体将被冻结 /// </summary> /// <param name="SonForm">the form to be showed</param> /// <param name="d">direction</param> /// <returns></returns> public DialogResult OpenNewFormDidlog(SmartForm SonForm, Direction d) { SonForm.direc = d; this.EventLocationChanged += SonForm.form_EventLocationChanged; TellRightPoint(); Form Son = (Form)SonForm; Son.Owner = this; this.Enabled = false; return(Son.ShowDialog()); }
public DialogResult OpenNewInputFormDidlog(SmartForm SonForm, Direction d) { SonForm.direc = d; this.EventLocationChanged += SonForm.form_EventLocationChanged; TellRightPoint(); Form Son = (Form)SonForm; SonForm.TopLevel = true; SonForm.TopMost = true; Son.Owner = this; SonForm.IsClosedGoback = false; return(Son.ShowDialog()); }
private void TellMatherReLocated(SmartForm mather, SmartForm son, Point sonLoca) { mather.EventLocationChanged -= son.form_EventLocationChanged; Point temp = new Point(); switch (son.direc) { case Direction.right: temp = new Point(sonLoca.X - mather.Width, sonLoca.Y); break; case Direction.left: temp = new Point(sonLoca.X + son.Width, sonLoca.Y); break; case Direction.top: temp = new Point(sonLoca.X, sonLoca.Y + son.Height); break; case Direction.down: temp = new Point(sonLoca.X, sonLoca.Y - mather.Height); break; } if (mather.Owner != null && mather.Owner is SmartForm) { TellMatherReLocated(mather.Owner as SmartForm, mather, temp); } mather.Location = temp; mather.EventLocationChanged += son.form_EventLocationChanged; }