Entwickler-Ecke

Grafische Benutzeroberflächen (VCL & FireMonkey) - Combobox(style "csDropDownList") zeigt beim Start


ak - Mo 18.08.03 20:06
Titel: Combobox(style "csDropDownList") zeigt beim Start
Hallo Leute,

ich habe eine Combobox (style=csDropDownList) damit sie sich aufklappt wen ich auf das "Feld neben dem Dreieck" drücke. Wenn ich aber in meiner Form.create Prozedur etwas wie:
combobox1.Text:='start';
combobox1.Items.Add('start');
reinschreibe sehe ich leider nichts im Textfeld meiner combobox. Was muss ich einstellen um etwas zu sehen, der style muss aber bei csDropDownList bleiben.


Delete - Mo 18.08.03 20:12

Das ist ja der Stil: du hast eine Liste zur Auswahl, aber nix zum reinschreiben. Daher lautet die Antwort:

Delphi-Quelltext
1:
combobox1.ItemIndex := 0;                    

Damit siehst du das erste Item. :)

Grüße.


MSCH - Mo 18.08.03 20:16

Text ist bei csDropDown readOnly !
also:

Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var I:Integer;
  I:= Liste.Items.add('start');
  Liste.ItemIndex:=I;
  // jetzt die anderen dazu
  //
  Liste.Items.delete(I);

grez
msch


ak - Mo 18.08.03 20:17

juut so klappt es dann in der form.create prozedur


Quelltext
1:
2:
combobox1.Items.Add('start ');
combobox1.ItemIndex:=0;


danke euch beiden