Autor Beitrag
Tendl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 117



BeitragVerfasst: Mi 18.06.03 12:53 
Mit dem OnDoubleClick-Event möchte ich eine Aktion auslösen. Dafür muß ich zunächst ermitteln welcher Node angeklickt worden ist. Aber wie? Wahrscheinlich gehts ganz einfach, aber ich komm im Moment nicht drauf.
Danke
Thomas
CenBells
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1547

Win 7
Delphi XE5 Pro
BeitragVerfasst: Mi 18.06.03 13:19 
beim klicken auf einen node wird der doch ausgewählt. Also ist das node wahrscheinlich treeview.selectedNode;

Gruß
Ken
Tendl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 117



BeitragVerfasst: Mi 18.06.03 13:45 
Titel: So einfach ist es leider nicht
Hallo CenBells
Die komponente Ttreeview oder präziser TJvTreeview, hat leider kein selectednode.
Es gibt JvTreeView1.SelectedItems, aber der Zugriff auf das Element 0 führt bereits zur Exception "out of bounds"

Auf jeden Fall vielen Dank für die schnelle Antwort.
Thomas
CenBells
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1547

Win 7
Delphi XE5 Pro
BeitragVerfasst: Mi 18.06.03 13:49 
und wie wäre es mit focused node?
Tendl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 117



BeitragVerfasst: Mi 18.06.03 14:04 
Den gibts auch nicht, aber ich hab die Lösung jetzt selber:
ausblenden Delphi-Quelltext
1:
2:
  if not (sender is TJvTreeview) then exit;
  node :=JvTreeView1.Selections[0];

Nochmals vielen Dank
Thomas

Moderiert von user profile iconTino: Delphi-Tags hinzugefügt.