AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Sonstige Fragen zu Delphi Delphi treeview subitems stateindex zuweisen!
Thema durchsuchen
Ansicht
Themen-Optionen

treeview subitems stateindex zuweisen!

Ein Thema von Muetzi · begonnen am 23. Nov 2003
Antwort Antwort
Muetzi
(Gast)

n/a Beiträge
 
#1

treeview subitems stateindex zuweisen!

  Alt 23. Nov 2003, 17:28
So, ich hoffe das ist jetzt mein letztes Problem...

Ich habe ne Treeview in etwa so:

Code:
Thema 1
             Unterpunkt1
             Unterpunkt2
Thema2
             Unterpunkt1
             Unterpunkt2
Jetzt brauche ich ne Schleife die den Unterpunkten ein Stateindex zuweist so:
Punk1 = 1
Punk2 = 2

Punk1 = 1
Punkt = 2

Also in jedem Thema von neuem Zählt.

Habs schon versucht, bekomms aber nicht hin!



Gruß

Muetzi
Delphi-Quellcode:
case zahl of
1 : begin form1.tv1.Items.AddChild(form1.tv1.Items[0],str1);
    form1.tv1.Items[ia[8]].Item[ia[1]].StateIndex := ia[1] + 1;
    ia[1]:= ia[1] + 1;
    inc(ia[8]);
    end;
 2 : begin form1.tv1.Items.AddChild(form1.tv1.Items[0],str1);
 form1.tv1.Items[ia[8]].Item[ia[2]].StateIndex := ia[2] + 1;
    ia[2]:= ia[2] + 1;
    inc(ia[8]);
    end;
3 : begin form1.tv1.Items.AddChild(form1.tv1.Items[0],str1);
form1.tv1.Items[ia[8]].Item[ia[3]].StateIndex := ia[3] + 1;
    ia[3]:= ia[3] + 1;
    inc(ia[8]);
    end;
4 : begin form1.tv1.Items.AddChild(form1.tv1.Items[0],str1);
form1.tv1.Items[ia[8]].Item[ia[4]].StateIndex := ia[4] + 1;
    ia[4]:= ia[4] + 1;
    inc(ia[8]);
    end;
5 : begin form1.tv1.Items.AddChild(form1.tv1.Items[0],str1);
form1.tv1.Items[ia[8]].Item[ia[5]].StateIndex := ia[5] + 1;
    ia[5]:= ia[5] + 1;
    inc(ia[8]);
     end;
6 : begin form1.tv1.Items.AddChild(form1.tv1.Items[0],str1);
form1.tv1.Items[ia[8]].Item[ia[6]].StateIndex := ia[6] + 1;
    ia[6]:= ia[6] + 1;
    inc(ia[8]);
     end;
 7 : begin form1.tv1.Items.AddChild(form1.tv1.Items[6],str1);
     form1.tv1.Items[ia[8]].Item[ia[7]].StateIndex := ia[7] + 1;
    ia[7]:= ia[7] + 1;
    inc(ia[8]);
     end;
end;
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:38 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz