void lbl_MouseClick(object sender, MouseEventArgs e) { ChangeListHistryLabel lbl = ((ChangeListHistryLabel)sender); if (e.X > lbl.Width - 20) { if (MessageView.ShowQuestionMsg("Delete Item") == DialogResult.OK) { using (ChangeList c = new ChangeList(true)) { c.ID = lbl.ChangeList.ID; c.Delete(); ReloadhistryLabels(); } } } }
private void AddChangeListHistry(List <ChangeList> list) { int y = 5; foreach (ChangeList c in list) { ChangeListHistryLabel lbl = new ChangeListHistryLabel(); lbl.Text = string.Concat(c.FromDate.ToString("yyyy-MMM-dd"), " සිට ", c.Todate.ToString("yyyy-MMM-dd"), " ", c.ForignCountry ? "පිටරට" : ""); lbl.Location = new Point(5, y); lbl.BackColor = Color.Transparent; lbl.ChangeList = c; y += lbl.Height + 3; this.histryGroup.Controls.Add(lbl); //lbl.MouseEnter += new EventHandler(lbl_MouseEnter); lbl.MouseLeave += new EventHandler(lbl_MouseLeave); lbl.MouseDoubleClick += new MouseEventHandler(lbl_MouseDoubleClick); lbl.MouseMove += new MouseEventHandler(lbl_MouseMove); lbl.MouseClick += new MouseEventHandler(lbl_MouseClick); } }
void lbl_MouseDoubleClick(object sender, MouseEventArgs e) { ChangeListHistryLabel lbl = ((ChangeListHistryLabel)sender); LoadChangeHistry(lbl.ChangeList); }