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.
Kirtan PatelPosted Dec 5, 2009, 10:51 PM
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 trghhyPosted Dec 6, 2009, 6:23 AM