private void patInfoCard_MouseUp(object sender, MouseEventArgs e) { Control ctrl = sender as Control; if (!ctrl.ClientRectangle.Contains(e.Location)) { return; } this.SelectedCard = sender as PatInfoCard; if (this.CardMouseClick != null) { this.CardMouseClick(sender, e); } }
public PatInfoCard AddPatInfo(EMRDBLib.PatVisitInfo patVisitLog) { PatInfoCard patInfoCard = new PatInfoCard(); patInfoCard.Dock = DockStyle.Top; // patInfoCard.MinimumSize = new Size(500, 28); patInfoCard.PatVisitLog = patVisitLog; patInfoCard.MouseUp += new MouseEventHandler(this.patInfoCard_MouseUp); patInfoCard.Tag = patVisitLog; this.Controls.Add(patInfoCard); if (this.PatInfoCards == null) { this.PatInfoCards = new List <PatInfoCard>(); } this.PatInfoCards.Add(patInfoCard); return(patInfoCard); }