
Şekil 1

Şekil 2
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];
ffor (i = 0; i < tbox.Length.Count; 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";
}
}
}
0 comments:
Yorum Gönder