VirtualTreeview鼠标移动到相应节点时,节点背景颜色发生变化
procedure TForm1.VirtualStringTree1BeforeItemErase(
Sender: TBaseVirtualTree; TargetCanvas: TCanvas; Node: PVirtualNode;
ItemRect: TRect;
var ItemColor: TColor;
var EraseAction: TItemEraseAction);
begin
if Sender.HotNode = Node
then
begin
EraseAction := eaColor;
ItemColor := clGreen;
end;
end;
procedure TForm1.VirtualStringTree1MouseMove(Sender: TObject;
Shift: TShiftState; X, Y: Integer);
begin
VirtualStringTree1.Invalidate;
end;
时间: 2024-10-10 23:11:59