Prevent nodes from getting selected

TeeTree VCL for Borland Delphi and C++ Builder.
Post Reply
Lenfors
Newbie
Newbie
Posts: 49
Joined: Thu Sep 20, 2007 12:00 am

Prevent nodes from getting selected

Post by Lenfors » Sat Nov 14, 2015 3:48 pm

Hello!

I TTree, how do I prevent all nodes from getting selected?

Best regards, Mikael

Yeray
Site Admin
Site Admin
Posts: 9622
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Prevent nodes from getting selected

Post by Yeray » Mon Nov 16, 2015 12:22 pm

Hello,
Lenfors wrote:I TTree, how do I prevent all nodes from getting selected?
If you only want the nodes not to look as selected, you can just change the color of the selected shapes and font:

Code: Select all

  Tree1.Selected.Color:=clNone;
  Tree1.Selected.TextColor:=clBlack;
If you don't want to have any shape in the Tree1.Selected list, you can clear it at OnClick event:

Code: Select all

procedure TForm1.Tree1Click(Sender: TObject);
begin
  Tree1.Selected.Clear;
end;
Or at OnMouseDown:

Code: Select all

procedure TForm1.Tree1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  Tree1.Selected.Clear;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply