I would need some advice or ideas on the problem I'm facing.
I would like to to create a textbox dynamically from an input string like example '11211'.
When it read the first character based on the string above, in this case '1', a textbox with background color yellow would be created.
The loop would continue creating textboxes horizontally till finished reading all the characters in string above.
Snippet of the code is as below :-
foreach (XmlNode xn in list1)
{
string name = xn["BinCode"].InnerText;
disGood.Text = name;
string input = name;
disOccupied.Text = input.Length.ToString();
char[] b = name.ToCharArray();
foreach (char c in b)
{
TextBox[] theTextBoxes = new TextBox[1];
for (int i = 0; i < theTextBoxes.Length; i++)
{
theTextBoxes[i] = new TextBox();
if (c.ToString() == "1")
{
theTextBoxes[i].BackColor = Color.Yellow;
}
}
disGood.Text = c.ToString();
}
}
Some sample or ideas would be high recommended.
Thank you.