![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Графика в Stringgrid [D6]
Alex © (2002-12-04 12:39:00)Задача следующая.
Нужно в ячейках StringGrid отобразить рисунки из ImageList.
Делаю так:
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
if (Acol=4) and (ARow=1) then
ImageList1.Draw(stringgrid1.Canvas,Rect.Left+1,Rect.Top+1,1);
(Acol=4) and (ARow=2) then
ImageList1.Draw(stringgrid1.Canvas,Rect.Left+1,Rect.Top+1,2);
(Acol=4) and (ARow=3) then
ImageList1.Draw(stringgrid1.Canvas,Rect.Left+1,Rect.Top+1,3);
end; </I>
Всё вроде бы получается, но при динамическом добавлении строки к Stringgrid (Stringgrid1.rowcount:=stringgrid1.rowcount+1) в ячейках (по примеру (4,1),(4,2),(4,3))появляются изображения из ImageList под номером 3.
Как избывиться от этого?
Спасибо!
Song (2002-12-04 13:30:00) [1]FillRect(Rect) поставь перед первый ImageList1.Draw(..)