 
 
Birden Fazla TextBox a Aynı Anda Çoklu Yazdırmak
Merhaba Arkadaşlar bu makalemizde dinamik olarak oluşturduğumuz 10 adet TextBox a aynı anda yazdıracağız.


Form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
         
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            //10 tane dinamik textbox oluşturuyoruz.
            int top = 50;
            TextBox[] tbox = new TextBox[10];
            for (int i = 0; i < tbox.Length; i++)
            {
                tbox[i] = new TextBox();
                tbox[i].Location = new Point(10, top);
                Controls.Add(tbox[i]);
                tbox[i].Text = "TextBox " + i;
                top += 25;
            }
        }  
        private void button1_Click(object sender, EventArgs e)
        {
            //tüm textboxlara aşağıdaki stringi yazdırıyoruz.
            int i;
            for (i = 0; i < this.Controls.Count; i++)
            {
                if (this.Controls[i] is TextBox)
                    this.Controls[i].Text = "Bahadır ŞAHİN";
            }
        }
        
    }
}
Bir makalenin daha sonuna geldik. Bir sonraki makalede görüşmek dileğiyle. Hoşçakalın. Bahadır ŞAHİN