Autor Beitrag
sunday_2
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 101


Delphi 7.0
BeitragVerfasst: Mi 13.11.02 14:43 
Hi,

ich habe eine ComboBox mit div Werten(auch Mehrfachwerte sprich 8 * 4) :lol: Gibt es eine Möglichkeit diese Werte nur einmal in der ComboBox angezeigt werden (nur einmal die 4)?

_________________
Gruß Sunday

... wer nicht fragt, bleibt dumm!!!
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Mi 13.11.02 14:49 
Hi.

Nein, das geht nicht ohne weiteres. Du musst dir selber dann dementsprechend die Combobox füllen (also schon vorhandene nicht noch einmal einfügen).
Evtl hilft dir dabei die Eigenschaft Duplicates der Klasse TStringlist, mit der du so einen "Filter" schnell hinbekommen kannst, schau einfach mal in die Hilfe.

Cu,
Udontknow
sunday_2 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 101


Delphi 7.0
BeitragVerfasst: Mi 13.11.02 14:55 
Daran kämpfe ich seit Stunden.
Kannst Du dir das mal ansehen?
www.auq.de/viewtopic.php?t=3997

_________________
Gruß Sunday

... wer nicht fragt, bleibt dumm!!!
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Mi 13.11.02 15:31 
Hmmm, das finde ich jetzt ein wenig verwirrend.

Ich poste lieber einfach mal Code, wie du die Items in deine ComboBox
packen kannst.

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
var StrL:TStringlist;
var i:integer;
begin
  //Erstellen einer temporären Stringliste
  StrL:=TStringlist.Create;
  try
    //neue Einträge sortieren, Duplikate nicht zulassen
    StrL.Sorted:=True;
    StrL.Duplicates:=dupIgnore;
    
    //Einfügen der AuswahlItems (evtl anpassen!)
    for i:=0 to Auswahl.Count-1 do
      StrL.Add(Auswahl[i]);

    //Items der ComboBox zuweisen 
    Combobox1.Items.Assign(StrL);
  finally
     //Stringliste freigeben
    StrL.Free;
  end;
end;


Cu,
Udontknow
sunday_2 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 101


Delphi 7.0
BeitragVerfasst: Mi 13.11.02 17:05 
Klappt wunderbar!

Danke! :lol:

_________________
Gruß Sunday

... wer nicht fragt, bleibt dumm!!!