🙂 İNSANLARIN EN HAYIRLISI INSANLARA FAYDALI OLANDIR 🙂

Burak HABER / C# / 67. Dinamik Araçlar

1-) C# - 67. Dinamik Araçlar

using System;

using System.Drawing;

using System.Windows.Forms;

 

namespace _67.Dinamik_Araçlar

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }

 

        private void button1_Click(object sender, EventArgs e)

        {

            Button btn = new Button();

            Point btnkonum = new Point(20, 10);

            btn.Location = btnkonum;

            btn.Name = "Button1";

            btn.Text = "Tıkla";

            btn.BackColor = Color.Red;

            btn.Height = 50;

            btn.Width = 75;

 

            Label lbl = new Label();

            Point lblkonum = new Point(100, 50);

            lbl.Location = lblkonum;

            lbl.Name = "Label1";

            lbl.Text = "RAMAZAN HABER";

            lbl.BackColor = Color.Green;

            lbl.AutoSize = true;

            //lbl.Width = lbl.Text.Length*15;

 

 

            for (int i = 1; i <=5 ; i++)

            {

                TextBox txt = new TextBox();

 

                Point txtkonum = new Point(350, i * 30);

                txt.Location = txtkonum;

                txt.Name = "Textbox" + i;

                txt.Text = i.ToString();

                this.Controls.Add(txt);

            }

            

 

            this.Controls.Add(lbl);

            this.Controls.Add(btn);

        }

    }

}

 

 2021 Mart 11 Perşembe
 450