Hi ,
Regarding to the First solution you should do that also for web
int countTimes = 0;
protected void Timer1_Tick(object sender, EventArgs e)
{
if (ViewState["countTimes"] == null)
{
countTimes = 1;
}
else
{
countTimes = Convert.ToInt32(ViewState["countTimes"]);
}
for (int i = 0; i < countTimes; i++)
{
Label lbl = new Label();
txtSkill.ID = "lbl" + i;
Form.Controls.Add(lbl);
}
countTimes = countTimes + 1;
ViewState.Add("countTimes", countTimes);
}
for windows
int i = 1;
private void timer1_Tick(object sender, EventArgs e)
{
Button button1 = new Button();
button1.Location = new System.Drawing.Point(105 + 20 * i, 92 + 20 * i);
button1.Name = "button" + i;
button1.Size = new System.Drawing.Size(75, 23);
button1.TabIndex = 0 + i;
button1.Text = "button" + i;
button1.UseVisualStyleBackColor = true;
this.Controls.Add(button1);
i++;
}
private void Form1_Load(object sender, EventArgs e)
{
timer1.Start();
}
Best Regards
M.Mitwalli