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

Выделение в ListView   Найти похожие ветки 

← →
Ranikin ©   (2003-01-14 16:07) [0]

Как выделить строку в ListView ?
Например :
procedure TForm1.ListView1DblClick(Sender: TObject);
begin
if (Not TListItem(Sender).Checked) Then begin
TListItem(Sender).Checked:= True;
ListView1.Canvas.Brush.Color:=clAqua;
ListView1.Canvas.Font.Color:= clBlack;
end Else begin
TListItem(Sender).Checked:= False;
ListView1.Canvas.Brush.Color:=clWhite;
ListView1.Canvas.Font.Color:= clBlack;
End;
Так как покрасить элемент ?


← →
pusrg ©   (2003-01-14 16:22) [1]

Перенеси код в OnDrawItem или OnCustomDrawItem


← →
Ranikin ©   (2003-01-14 16:36) [2]

Если перенести в OnDrawItem и поставить в OnClick
ListView.OwnerDraw := True то перерисовка происходит только один раз и все...


← →
ZEE ©   (2003-01-14 17:26) [3]

...
ListView1.OwnerDraw:=true;
...

ListView1DrawItem(...);
begin
TListItem(Sender).Checked:=not TListItem(Sender).Checked;
if TListItem(Sender).Checked then
begin
ACanvas.Canvas.Brush.Color:=clAqua;
ACanvas.Canvas.Font.Color:=clBlack;
ACanvas.TextOut(...);
end else
begin
ACanvas.Canvas.Brush.Color:=clWhite;
ACanvas.Canvas.Font.Color:=clBlack;
ACanvas.TextOut(...);
end;
end;


Примерно так



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

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



Память: 0.45 MB
Время: 0.01 c
3-72168
OPS
2003-01-04 16:36
2003.01.23
INTERBASE


3-72116
Nikolai_S
2002-12-25 18:02
2003.01.23
ADO.


1-72311
Chubais
2003-01-15 15:29
2003.01.23
как найти вызов dll


1-72211
diks
2003-01-14 12:18
2003.01.23
Кнопочки


6-72440
Dmittry
2002-11-19 12:09
2003.01.23
Как узнать MAC адрес???




   Наверх