Тема: Таблица
Показать сообщение отдельно
  #36  
Старый 22.01.2012, 00:07
Аватар для angvelem
angvelem angvelem вне форума
.
 
Регистрация: 18.05.2011
Адрес: Омск
Сообщения: 3,970
Версия Delphi: 3,5,7,10,12,XE2
Репутация: выкл
По умолчанию

Так ведь ты текст не вывел. То что ты его присвоил ячейке не означает, что он выведется на передний план.
Код:
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
begin
  with (Sender as TStringGrid).Canvas do
  begin
    Draw(Rect.Left, Rect.Top, Image1.Picture.Graphic);
    TextOut(Rect.Left + Font.Size, Rect.Top + 2, 'Owner Drawn text');
  end;
end;
точнее так:
Код:
procedure TForm2.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
begin
  with (Sender as TStringGrid), Canvas do
  begin
    Draw(Rect.Left, Rect.Top, Image1.Picture.Graphic);
    Brush.Style := bsClear;
    if Cells[ACol, ARow] <> '' then
      TextOut(Rect.Left + Font.Size, Rect.Top + 2, Cells[ACol, ARow]);
  end;
end;
__________________
Je venus de nulle part
55.026263 с.ш., 73.397636 в.д.
Ответить с цитированием