Autor Beitrag
Terra23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 872

Win 8
Delphi 7
BeitragVerfasst: Sa 06.01.07 19:54 
Hallo!

Ich habe ein Treeview in meinem Programm. Das hat 27 Überpunkte (#, A, B, C ... Z) und jeder Überpunkt hat mehrere Unterpunkte z.B.:

A
-> Alex
-> Andre
-> Anita
-> Anton

B
-> Ben
-> Bianca
-> Bella

Ich reagiere in meinem Programm auf das Event "Doppelklick", allerdings soll das Programm dann auch nur was tun, wenn ein Unterpunkt gewählt wurde und nicht etwa wenn man doppelt auf "A" klickt.

Ich hoffe, ihr könnt mir helfen.

Die Suche führte mich nicht wirklich weiter.

Terra


Moderiert von user profile iconGausi: Topic aus Sonstiges (Delphi) verschoben am Sa 06.01.2007 um 19:59

_________________
Hasta La Victoria Siempre
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Sa 06.01.07 19:58 
Jeder TTreeNode hat die eigenschaft Level.
Bei A und B ist Level dann 0 und bei den anderen 1.

MfG
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Sa 06.01.07 20:01 
Hallo!

Der entsprechende Node sollte keinen Parent haben (Parent-Eigenschaft ist nil), wenn er ein "Überpunkt" ist.

Grüße
Christian

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Terra23 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 872

Win 8
Delphi 7
BeitragVerfasst: Sa 06.01.07 20:04 
Also quasi:

ausblenden Delphi-Quelltext
1:
2:
If Not TreeView1.Parent=nil
Then ...


???

Mit Level weiß ich nicht, wie das geht. Ich kanns auch im Moment nicht probieren, Delphi ist nicht an.

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

_________________
Hasta La Victoria Siempre
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Sa 06.01.07 20:18 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.TreeView1DblClick(Sender: TObject);
begin
  if TreeView1.Selected.Level > 0 then
    Unterpunkt
end;


MfG
Terra23 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 872

Win 8
Delphi 7
BeitragVerfasst: Sa 06.01.07 20:21 
Danke.

_________________
Hasta La Victoria Siempre