1
Example I did this because I am creating Controls and names dynamically, well. the problem is when I need to use or call these values.
If I want to change the value of the control your text or value ,something like that. I wonder if there’s a way to do it.
My code:
public int Playes = 0;
private void Criacao()
{
Playes += 1;
string HP0 = "Lab" + Playes.ToString(); //Sempre que criar o controlle Adiciona 1 no int Playes, dai o nome fica algo como : "Lab1"
Label L1 = new Label(); //Criação do label.
L1.Name = HP0; // definir nome da label.
L1.AutoSize = true; //Define o tamanho automaticamente.
}
Simply put, I wonder if there’s any way to change the value of the controls,
different example Lab1.text = "teste"
or Lab2.text = "teste2";
, because I’m changing the name in process I don’t know how to call it.
(Sorry if this explained poorly, I’m still layman.)
Put the code that generates the controls dynamically because otherwise it is difficult to adapt the logic you used
– Victor Laio