Autor Beitrag
Hansi@OMG
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 304

Vista
Delphi 2006 Prof., Lazarus
BeitragVerfasst: Fr 15.06.07 21:23 
Hallo,
ich suche nach einer Möglichkeit herauszufinden, ob ein Treenode kein Parent mehr hat.
Versucht hab ichs bis jetzt so (im Ondragdrop):
ausblenden Delphi-Quelltext
1:
if treeview1.getnodeat(x,y).hasasparent(nil)=false then exit;					


aber irgendwo hab ich einen Denkfehler drinnen, weil trotzdem immer noch untergeordnete Knoten verwendet werden können.

_________________
Who doesn't know the Micrsoft developer "Mahatma Fatal Error"?
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Fr 15.06.07 21:41 
Hallo,

falls ich Dich richtig verstanden habe, dann so:
ausblenden Delphi-Quelltext
1:
2:
if assigned(TreeView.Getnodeat(x,y).Parent) then 
  exit;

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Kalfany
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 26

Win 2000 SP4, XP SP2
D5 Enterprise, C# SharpDevelop, D2007 Enterprise
BeitragVerfasst: Do 17.01.08 16:35 
müsse so aber auch gehn:

ausblenden Delphi-Quelltext
1:
2:
if TreeView.GetNodeAt(x,y).Level = 0 then  
  exit;