Problem ze StringGrid

0

Potrzebuje wyroznic pewne pola w komponencie TStringGrid (inny kolor komorki, badz pogrubiony text). Probowalem nawet uzyc canvasa na StringGridzie, ale nic mi nie wychodzi. Prosze pomozcie mi, moze ktos juz zetknal sie z podobnym problemem

JmP

0

a ownerdraw nie dziala?

0

Nie sprawdzalem, a jak tego uzyc?

JmP

0

ustawiasz defaultdraw na false i możesz robic fajne rzeczy, np:

procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
begin
  with Sender as TStringGrid do
    begin
      Canvas.Brush.Color:=clRed;
      if (ACol=0) or (ARow=0) then
        begin
          Canvas.FillRect(Rect);
          Canvas.Brush.Style:=bsBDiagonal;
        end
      else
        Canvas.Brush.Style:=bsSolid;
      Canvas.Brush.Color:=clAqua;
      Canvas.FillRect(Rect);
      Canvas.TextOut(Rect.Left, Rect.Top, Cells[ACol, ARow]);
      if gdFocused in State then
        Canvas.DrawFocusRect(Rect);
    end;
end;
0

TO DZIALA. Wielkie dzieki za pomoc [hurra] [hurra]

JmP

1 użytkowników online, w tym zalogowanych: 0, gości: 1