Delphi XE4 Tpanel doesnt change color

49 views Asked by At

In my program (Chess) i need to generate a lot of Tpanels with a specific background color(black or white). Tpanels are created, but, despite setting the color, they remain colorless.

for i := 1 to 8 do
  for j := 1 to 8 do
  begin
    CellArray[i,j]:= TPanel.Create(Chess);
    CellArray[i,j].Parent := Chess;
    CellArray[i,j].Left := 20+(i-1)*70;
    CellArray[i,j].Top := 20+(j-1)*70;
    CellArray[i,j].Width := 70;
    CellArray[i,j].Height := 70;
    CellArray[i,j].Tag := i*10+j;
    if odd(i+j) then 
      CellArray[i,j].Color := clblack
    else 
      CellArray[i,j].Color := clwhite;
  end;
0

There are 0 answers