I'm trying to retrieve 12 label and 3 textBox numbers and put in another 15 label, I tried with array, but I don't really get into arrays yet, I would like if anyone can help me, I'm very grateful, I'll leave an Ex:
I'm using this on the button to generate 12 numbers on the label from Class Aleatorios
then there are 3 textBox that will be filled by the user with numbers of their choice, thus generating a total of 15 numbers from 1 to 99, I would like these 15 numbers (12 Label and 3 TextBox to appear elsewhere on the page or in 15 label or an array, I confess that I have no idea how to do this, I've already looked for a way but I couldn't,
if anyone is willing to help me i would appreciate it.
I'm using this on the button to generate 12 numbers on the label from Class Aleatorios
C#:
private void BtnGeraAleatorios_Click(object sender, EventArgs e)
{
Aleatorios ale = new Aleatorios();
int[] numerosSorteados = ale.GeradorNaoRepetidoss(12, 1, 99);
Array.Sort(numerosSorteados);
Control[] controles = { lblAle1, lblAle2, lblAle3, lblAle4, lblAle5, lblAle6, lblAle7, lblAle8, lblAle9, lblAle10, lblAle11, lblAle12 };
//if (lblAle1.Text.Length != 0)
//{
// int[] vetor = label2.Text.ToCharArray().Cast<int>().ToArray();
//}
for (int i = 0; i < controles.Length; i++)
{
int valor = numerosSorteados[i];
controles[i].Text = valor + "";
}
then there are 3 textBox that will be filled by the user with numbers of their choice, thus generating a total of 15 numbers from 1 to 99, I would like these 15 numbers (12 Label and 3 TextBox to appear elsewhere on the page or in 15 label or an array, I confess that I have no idea how to do this, I've already looked for a way but I couldn't,
if anyone is willing to help me i would appreciate it.