Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
StringGrid1.Canvas.Font.Color := clBlack; [color green]// Default color[/color]
StringGrid1.Canvas.Brush.Color := clWhite;
if ((ACol = 0) OR (ARow = 0)) then [color green]// First check if Fixed row or column[/color]
begin
StringGrid1.Canvas.Brush.Color := clBtnFace;
end
else
begin
if not (ARow = (StringGrid1.RowCount - 1)) then [color green]// Avoid empty row[/color]
begin
if (ItemsSelected[StringGrid1.Row - 1] = True) then
begin [color green]// Will only color selected rows[/color]
StringGrid1.Canvas.Font.Color := clWhite;
StringGrid1.Canvas.Brush.Color := clBlue;
end;
end;
end;
StringGrid1.Canvas.FillRect(Rect);
StringGrid1.Canvas.TextOut(Rect.Left, Rect.Top, StringGrid1.Cells[ACol, ARow]);
end;
procedure TForm1.StringGrid1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
col, row : Integer;
begin
StringGrid1.MouseToCell(X, Y, col, row); [color green]// This will tell us what cell (we need row) was selected[/color]
if ((row > 0) AND (row < StringGrid1.RowCount - 1)) then [color green]// Again don't select fixed or blank row[/color]
if (ItemsSelected[StringGrid1.Row - 1] = True) then
begin
ItemsSelected[StringGrid1.Row - 1] := False;
end
else
begin
ItemsSelected[StringGrid1.Row - 1] := True;
end;
StringGrid1.Invalidate;
end;