No problem. If you will have any other questions don't be shy.
No problem. If you will have any other questions don't be shy.
I'm still not sure how to iterate over the imagelist.
The code I have is...
index := ARow * grdPlayField.ColCount + ACol;
grdPlayField.Canvas.Brush.Color := clMaroon;
grdPlayField.Canvas.FillRect(Rect);
imlSpheres.Draw(grdPlayField.Canvas,Rect.Left,Rect .Top,index, True);
if (gdFocused in State) then
begin
grdPlayField.Canvas.DrawFocusRect(Rect);
end;
...It works for simply displaying the nine items on the grid in the appropriate cells, but I can't figure out how to tell Delphi to keep assigning the elements until the grid is full.
You're only showing what you do with 1 element. Is there a for or while structure we can take a look at? Iterating 2D table is really easy
Code:var i, j: integer; ... for j:=0 to RowCount-1 do for i:=0 to ColCount-1 do begin // Do something with element[i, j] ... end;
Bookmarks