var btnU = new Button(); btnU.Location = new Point(1280, 3); btnU.Size = new Size(40, 26); btnU.ForeColor = System.Drawing.Color.Red; btnU.BackColor = System.Drawing.Color.White; btnU.Font = font; btnU.Text = "Prev"; btnU.Click += new System.EventHandler(btnU_Click); //The name "btnU_Click" does not exist in the current context btnU.Click += (s, e) => MessageBox.Show("Hi there from btnU PREV"); this.Controls.Add(btnU); btnU.Show();
Button btnU = new Button();
btnU.Click += (sender, eventHandler) => { /* put some code here, use any of sender or eventHandler, or both, or none of those parameters */ }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)