void Menu_Click(object sender, EventArgs e) { Program.TimerReset(); var MenuButton = sender as Button; menu = new AttendMenu(); menu.Tag = MenuButton.Tag; menu.Parent = this; menu.Location = new Point(MenuButton.Location.X - 100, MenuButton.Location.Y + MenuButton.Height); mask = new Label(); mask.BackColor = this.BackColor; mask.Size = this.Size; //mask.Location = this.Location; mask.Parent = this; mask.BringToFront(); var nam = this.Controls[this.Controls.IndexOfKey("name" + menu.Tag.ToString())] as Button; var org = this.Controls[this.Controls.IndexOfKey("org" + menu.Tag.ToString())] as Label; nam.BringToFront(); org.BringToFront(); mask.Show(); menu.VisitClass += Visit_Click; var c = list[(int)menu.Tag]; nam.Enabled = false; menu.EditRecord += EditRecord_Click; menu.PrintLabel += PrintLabel_Click; menu.AddFamily += AddToFamily_Click; menu.JoinClass += Join_Click; if (c.cinfo.oid != 0) { menu.DropJoin.Visible = true; if (c.cinfo.mv == "M") { menu.DropJoinClass += DropThis_Click; menu.DropJoin.Text = "Drop This Class"; } else { menu.DropJoinClass += JoinThis_Click; menu.DropJoin.Text = "Join This Class"; } } else { menu.DropJoin.Visible = false; } menu.CancelMenu += new EventHandler(CancelMenu_Click); menu.Show(); menu.BringToFront(); }
void Menu_Click(object sender, EventArgs e) { Program.TimerReset(); var MenuButton = sender as Button; menu = new AttendMenu(); menu.Tag = MenuButton.Tag; menu.Parent = this; menu.Location = new Point(MenuButton.Location.X - 100, MenuButton.Location.Y + MenuButton.Height); mask = new Label(); mask.BackColor = this.BackColor; mask.Size = this.Size; //mask.Location = this.Location; mask.Parent = this; mask.BringToFront(); var nam = this.Controls[this.Controls.IndexOfKey("name" + menu.Tag.ToString())] as Button; var org = this.Controls[this.Controls.IndexOfKey("org" + menu.Tag.ToString())] as Label; nam.BringToFront(); org.BringToFront(); mask.Show(); menu.VisitClass += Visit_Click; var c = list[(int)menu.Tag]; nam.Enabled = false; menu.EditRecord += EditRecord_Click; menu.PrintLabel += PrintLabel_Click; menu.AddFamily += AddToFamily_Click; menu.JoinClass += Join_Click; if (c.cinfo.oid != 0) { menu.DropJoin.Visible = true; if (c.cinfo.mv == "M") { menu.DropJoinClass += DropThis_Click; menu.DropJoin.Text = "Drop This Class"; } else { menu.DropJoinClass += JoinThis_Click; menu.DropJoin.Text = "Join This Class"; } } else menu.DropJoin.Visible = false; menu.CancelMenu += new EventHandler(CancelMenu_Click); menu.Show(); menu.BringToFront(); }