Ahoj,
snažím se obarvit draw grid v delphi. Při spuštění programu se ale nic neděje. Měli byste řešení prosím?
KÓD:
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Grids;
type
TForm1 = class(TForm)
DrawGrid1: TDrawGrid;
procedure Drawgrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Drawgrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState);
Const modra = TColor($FF0000);
cervena = TColor($0000FF);
pole = TColor($00FFFF);
var i,l : integer;
begin
i:=ACol;
l:=ARow;
if i = 4 then begin DrawGrid1.Canvas.Brush.Color := modra;
DrawGrid1.Canvas.FillRect(Rect);
end;
end;
end.