Get the id of a Panel that is being created dynamically

0

I'm creating multiple dashboards dynamically according to the number of entries in a database table and data:

pnlBtn := TPanel.Create(Self); // Cria o um Panel
      pnlBtn.Parent := pnlMesas; // seta pnlMesa como parente

      sTop := FloatToStr(rTop);
      sLeft := FloatToStr(rLeft);

      //Posição do Panel
      pnlBtn.Top := StrToInt(sTop);
      pnlBtn.Left := StrToInt(sLeft);

      //Tamanho do Panel
      pnlBtn.Width := 103;
      pnlBtn.Height := 50;

      //Informações Gerais do panel
      pnlBtn.Name := 'pnlMesaComanda' + intToStr(iContador);

And I wanted to create several labels inside this dynamic panel with the information registered in the bank however how do I get the id of this panel that I created dynamically to put in the parent?

example:

lblCod := TLabel.Create(Self);
lblCod.Parent := 'pnlMesaComanda' + intToStr(iContador);

Can anyone help me?

    
asked by anonymous 05.01.2017 / 13:29

1 answer

2

In delhpi it does not have this id question, but the component names serve with identifier. Then his Name will be the id, or you can create a variable inside it with the to be the ID.

    
05.01.2017 / 13:35