I have problems in my textbox array, there are 15 indexes,
each index receives two digits, however if I type letters it is accepting.
I wanted it to accept only numerical digits, two numbers per index,
Anyone willing to give me some information on how I can proceed with this?
I am very grateful
my code
each index receives two digits, however if I type letters it is accepting.
I wanted it to accept only numerical digits, two numbers per index,
Anyone willing to give me some information on how I can proceed with this?
I am very grateful
my code
C#:
private TextBox[] ResultText = new TextBox[15];
C#:
private void GeraControles()
{
int i, esquerda = 105, topo = 230;
for (i = 0; i < 15; i++)
{
ResultText[i] = new TextBox();
//ResultText[i].Name = "label" + i;
//ResultText[i].Text = ResultText[i].Name;
//ResultText[i].Anchor = AnchorStyles.Right;
//ResultText[i].Location = new Point(ResultText[i].Location.X + 20, ResultText[i].Location.Y + 300);
ResultText[i].Left = esquerda;
ResultText[i].Top = topo;
ResultText[i].Anchor = new AnchorStyles();
ResultText[i].BackColor = Color.Gray;
ResultText[i].ForeColor = Color.White;
ResultText[i].Size = new Size(45, 30);
ResultText[i].Font = new Font("", 15, FontStyle.Bold);
ResultText[i].TabIndex = 2;
ResultText[i].BorderStyle = BorderStyle.FixedSingle;
this.Controls.Add(ResultText[i]);
esquerda += (ResultText[i].Width + 5);
ResultText[i].Tag = i;
}
}