Вниз
Скачать: CL | DM;

Графика в Stringgrid   Найти похожие ветки 

 
Alex ©   (2002-12-04 12:39) [0]

Задача следующая.
Нужно в ячейках 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) [1]

FillRect(Rect) поставь перед первый ImageList1.Draw(..)



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.44 MB
Время: 0.012 c
4-54362
Sodom
2003-01-24 13:00
2003.03.17
Хук WH_CBT


7-54350
Dd
2003-01-22 20:44
2003.03.17
Кто нить знает как отключить...


14-54171
Hirara
2003-02-27 00:42
2003.03.17
Порты всякие


6-54134
Ihor Borysyuk
2003-01-27 10:47
2003.03.17
Прокси в Internet Explorer.


6-54151
GobliNGuT
2003-01-24 11:03
2003.03.17
Работа с 2-мя прокси...




   Наверх