s.a.
yeni bir proje başlat. forma bir tane stringgrid koy.
editing ini true defaultdraw ını false yap. sonra
sonra drawcell eventina aşağıdaki kodu yapıştır.
bu kod sana yol gösterecektir.
Kod: Tümünü seç
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
if (acol>StringGrid1.FixedCols-1) and (arow>StringGrid1.FixedRows-1) then
begin
if StringGrid1.Selection.Top=arow then
begin
StringGrid1.Canvas.Brush.Color:=clred;
end else StringGrid1.Canvas.Brush.Color:=clWhite;
end else
begin
StringGrid1.Canvas.Brush.Color:=StringGrid1.FixedColor;
end;
StringGrid1.Canvas.Rectangle(rect);
StringGrid1.Canvas.TextOut(rect.Left+2,rect.Top+2,StringGrid1.Cells[acol,arow]);
end;
kolay gelsin.