Button x = new Button(); // Add properties to the form x.Name = "btn" + m_ControlCount.ToString(); x.Text = "btn" + m_ControlCount.ToString(); x.Location = new Point(this.m_Location.X + 250, this.m_Location.Y); m_Location.Y += x.Height + 5; // Add the two event handlers x.Click += new System.EventHandler(myButtonHandler_Click); x.MouseHover += new System.EventHandler(myButtonHandler_MouseHover); // Add the control to the collection of controls Controls.Add(x);
TextBox txt = new TextBox(); this.Controls.Add(txt);...
// Add properties to the form
x.Name = "btn" + m_ControlCount.ToString();
x.Text = "btn" + m_ControlCount.ToString();
x.Location = new Point(this.m_Location.X + 250, this.m_Location.Y);
m_Location.Y += x.Height + 5;
// Add the two event handlers
x.Click += new System.EventHandler(myButtonHandler_Click);
x.MouseHover += new System.EventHandler(myButtonHandler_MouseHover);
// Add the control to the collection of controls
Controls.Add(x);
this.Controls.Add(txt);...