Deselect a treeview's element in delphi -


i need deselect item of treeview in delphi.

here failed try:

1) treeview1.selected.selected := false;

2) treeview1.selected.data := nil;

3) treeview1.select(nil,[]);

4)

  := 0 treeview1.items.count - 1         treeview1.items[i].selected := false; 

5)

  treeview1.multiselect := true;   := 0 treeview1.items.count - 1       treeview1.items[i].selected := false;       treeview1.multiselect := false; 

6)

var nulla : ttreenode; 

nulla := nil; treeview1.select(nulla, []); 

7) treeview1.clearselection(false);

8) treeview1.clearselection(true);

they crash program (except 8, doesn't anything), how can this?
goal deselect clicking on white space.

setting ttreeview.selected property nil, or setting ttreenode.selected property false, correct approach.

1 , 2 crash if ttreeview.selected nil, other approaches should work fine, provided ttreeview pointer valid pointer begin with.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -