Autor Beitrag
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Mi 20.10.04 20:54 
Hi
Ich brauche den Index des Selectierten Items.

for Zeile:=TreeView1.Selected downto 0 doFunktioniert da nicht... :?


Moderiert von user profile iconChristian S.: Topic aus CLX / Delphi Language (Object-Pascal) verschoben am Do 21.10.2004 um 16:26
wulfskin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1349
Erhaltene Danke: 1

Win XP
D5 Pers (SSL), D2005 Pro, C, C#
BeitragVerfasst: Mi 20.10.04 21:04 
So gehts:
ausblenden Delphi-Quelltext
1:
2:
  if Assigned(Selected) then
    Index := ListView1.IndexOf(Selected) {..};
Gruß Hape!

_________________
Manche antworten um ihren Beitragszähler zu erhöhen, andere um zu Helfen.
Coder Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Do 21.10.04 14:31 
Thx, aber irgendwie geht das nicht. :?

Also ich brauch die Zeilennummer des angeklickten Items in einem TreeView.
wulfskin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1349
Erhaltene Danke: 1

Win XP
D5 Pers (SSL), D2005 Pro, C, C#
BeitragVerfasst: Do 21.10.04 14:35 
Ok, geht auch einfacher ;):
ausblenden Delphi-Quelltext
1:
2:
  if Assigned(ListView1.Selected) then
    ShowMessage(IntToStr(ListView1.Selected.Index));

_________________
Manche antworten um ihren Beitragszähler zu erhöhen, andere um zu Helfen.
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Do 21.10.04 14:38 
geht so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
  if assigned(TreeView1.Selected) then begin
    ShowMessage(IntToStr(TreeView1.Selected.AbsoluteIndex));
    ShowMessage(IntToStr(TreeView1.Selected.Index));
  end;

Source spricht für sich.
Coder Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Do 21.10.04 14:43 
THX, funktioniert spitzenmäsig :D