how to add new button to form

73

how to add new button to form -

private void Form1_Load(object sender, EventArgs e)
    {
        Button testbutton = new Button();
        testbutton.Text = "button1";
        testbutton.Location = new Point(70, 70);
        testbutton.Size = new Size(100, 100);
        testbutton.Visible = true;
        testbutton.BringToFront();
        this.Controls.Add(testbutton);

    }

Comments

Submit
0 Comments