Autor Beitrag
mexx
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Mo 21.08.06 14:39 
Hallo,

ich möchte die Columns einer ListView dynamisch erzeugen. Wie geht das? Die Delphisuche und Google-Suche führt mich zu Ergebnissen, wie man Einträge hinzufügt, aber keine Columns.

Thanks for Help!

_________________
Das Unsympathische an den Computern ist, dass sie nur ja oder nein sagen können, aber nicht vielleicht.
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mo 21.08.06 14:49 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
 with Listview1.Columns.Add do
 begin
  caption := 'blubb';
 end;

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Di 22.08.06 09:46 
Ich dank Dir, aber ich möchte noch etwas genauer auf mein Ziel eingehen. Ich habe einen Stringliste, welche die Inhalte enthält, die auch als Column dargestellt werden sollen. Die Liste enthält aber unter Umständen auch mal einen Eintrag mehrfach. Wie kann ich prüfen, ob der Eintrag in der Liste bereits vorhanden ist?

Ich habe es schon mit einer for schleife auf die Entrys versucht, aber wahrscheinlich einne logischen Fehler gemacht. Wie würdet Ihr das lösen?

Hier mal mein Code. Ich habe 2 Listen gleichen Inhaltes. Ich brauche aber einen Liste, die die doppelten Einträge nicht enthält.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
      for x:=0 to Entrys.Count-1 do
       begin
        for k:=0 to Entrys2.Count-1 do
         begin
          if Entrys[x] <> Entrys2[k] then
           begin
            with Listview1.Columns.Add do
             begin
              caption := Entrys.Strings[i];
             end;
           end;
         end;
        end;

_________________
Das Unsympathische an den Computern ist, dass sie nur ja oder nein sagen können, aber nicht vielleicht.