G
Guest
Hello,
I've created a dynamic button and checkbox and i want to create an event for
each one of them.
altough i've created the event and assigned them to each control, nothing
happens,
the event is not occurring.
What am i doing wrong?
this is my code for the checkBox:
CheckBox cb = new CheckBox();
cb.Text = "Text";
cb.Font.Bold = true;
cb.ID = "Friend_cb";
cb.Font.Name = "Tahoma";
cb.Font.Size = new FontUnit("16pt");
cb.ForeColor = Color.Blue;
cb.Checked = false;
cb.CheckedChanged += new System.EventHandler(Show_OutSide_TextBox);
cb.EnableViewState = true;
this.form1.Controls.Add(cb);
private void Show_OutSide_TextBox(object sender, System.EventArgs e)
{
if (((CheckBox)sender).Checked == true)
{
Create_Label(0, "<br><br>");
Create_OutSide_Player_TextBox();
}
}
Thanks,
Gidi
I've created a dynamic button and checkbox and i want to create an event for
each one of them.
altough i've created the event and assigned them to each control, nothing
happens,
the event is not occurring.
What am i doing wrong?
this is my code for the checkBox:
CheckBox cb = new CheckBox();
cb.Text = "Text";
cb.Font.Bold = true;
cb.ID = "Friend_cb";
cb.Font.Name = "Tahoma";
cb.Font.Size = new FontUnit("16pt");
cb.ForeColor = Color.Blue;
cb.Checked = false;
cb.CheckedChanged += new System.EventHandler(Show_OutSide_TextBox);
cb.EnableViewState = true;
this.form1.Controls.Add(cb);
private void Show_OutSide_TextBox(object sender, System.EventArgs e)
{
if (((CheckBox)sender).Checked == true)
{
Create_Label(0, "<br><br>");
Create_OutSide_Player_TextBox();
}
}
Thanks,
Gidi