VirtualTreeView: properly handling selection changes

后端 未结 4 757
自闭症患者
自闭症患者 2021-02-02 01:26

This question will seem obvious to those who haven\'t encountered the problem themselves.

I need to handle selection changes in VTV. I have a flat list of nodes. I need

4条回答
  •  天涯浪人
    2021-02-02 01:57

    You forgot OnStateChange event. This event will be fired right after any selection change and you can then handle all selected nodes.

    procedure TForm1.vstStateChange(Sender: TBaseVirtualTree; Enter,
      Leave: TVirtualTreeStates);
    begin
      if tsChangePending in Leave then
        DoSomething;
    end;
    

提交回复
热议问题