VirtualTreeview鼠標移動到相應節點時,節點背景顏色發生變化

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;
相關文章
相關標籤/搜索