//2.离开焦点隐藏ShowCard protected override void OnLeave(EventArgs e) { if (cardDataGrid.GetIsFocused()) { //this.Focus(); return; } else { cardDataGrid.Hide(); } if (this.MemberValue == null || this.MemberValue.ToString() == "") { this.Text = ""; this.SelectedValue = null; } else { this.MemberValue = ((DataRow)this.SelectedValue)[this.MemberField]; if (this.MemberValue == null) { this.Text = ""; this.SelectedValue = null; } else { this.Text = ((DataRow)this.SelectedValue)[this.DisplayField].ToString(); } } base.OnLeave(e); }
//2.离开焦点隐藏ShowCard protected override void OnLeave(EventArgs e) { if (cardDataGrid.GetIsFocused()) { //this.Focus(); return; } else { cardDataGrid.Hide(); } base.OnLeave(e); }