Inserting word into tablelayoutpanel
Hi,
i can able to insert random letters in TableLayoutPanel with this code
private void form_Load(object sender, EventArgs e)
{
for (int a = 0; a < tableLayoutPanel1.ColumnCount; a++)
{
for (int b = 0; b < tableLayoutPanel1.RowCount; b++)
Random r = new random();
lable nl = new lable();
int x = r.nest(65,90);
char c = (char)x;
nl.text = c.tostring();
tableLayoutPanel1.Controls.Add(nl, a, b)
}
}
}
i couldn't able to insert chosen words into TableLayoutPanel .pls help me.
how to change the color of letters when they click answer.
thanks in avance.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Kirtan PatelRank #292 · 8.6K reputationPosted Dec 5, 2009, 5:51 PM EST
Random r = new Random();
private void button1_Click(object sender, EventArgs e)
{
for (int i = 0; i < tableLayoutPanel1.RowCount; i++)
{
for (int j=0; j < tableLayoutPanel1.ColumnCount; j++)
{
Label l = new Label();
char x = (char)r.Next(65, 90);
l.Text = x.ToString();
tableLayoutPanel1.Controls.Add(l);
}
}
}
qwerfghj trghhy3 reputationPosted Dec 6, 2009, 1:23 AM EST