public static void ShowModal(string refText) { using (FrmPopupCURDGrid frm = new FrmPopupCURDGrid()) { frm.RefText = refText; frm.ShowDialog(); } }
public RefTextBox() { refForm = FrmPopupCURDGrid.GetForm(); refForm.Owner = FindForm(); }
void Control_KeyUp(object sender, KeyEventArgs e) { Rectangle rectCell = GetCellDisplayRectangle(CurrentCell.ColumnIndex, CurrentCell.RowIndex, true); string colName = Columns[CurrentCell.ColumnIndex].DataPropertyName; string controlText = (sender as Control).Text; //e.KeyCode!=Keys.Enter 条件可防止Enter回填时引发本过程,导致Ref窗体再次出现 if (controlText.Length > 0 && EditingControl.Text!=oldEditingControlText && e.KeyCode!=Keys.Enter) { oldEditingControlText = EditingControl.Text; if (refForm == null) { refForm = new FrmPopupCURDGrid(); refForm.Owner = FindForm(); } refForm.RetAction = ColRetActions[colName]; if (refForm.Visible == false) { refForm.Visible = true; } Point formLocation = this.PointToScreen(rectCell.Location); refForm.Location = new Point(formLocation.X, formLocation.Y + rectCell.Height); refForm.RefreshList(ColPopupFuncs[colName](controlText)); } }
public static FrmPopupCURDGrid GetForm() { if (ThisForm == null) ThisForm = new FrmPopupCURDGrid(); return ThisForm; }