Autor Beitrag
WormHole
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 145



BeitragVerfasst: Mi 13.07.05 17:59 
Ich hab ne Combobox und möchte den Items verschiedene events zuordnen.
Also zB

1 - label1 wird invisible
2 - label2 wird invisible

gz tschüss byebye ty und so
cu wormhole


Moderiert von user profile iconraziel: Topic aus Sonstiges verschoben am Mi 13.07.2005 um 20:16
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Mi 13.07.05 19:15 
Dann schreib bei onChange der ComboBox Code rein, indem du vergleichst, welches Item markiert ist. Wenn du ein Codebeispiel brauchst: Einfach die Suchfunktion verwenden ;)

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
WormHole Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 145



BeitragVerfasst: Mi 13.07.05 19:33 
Sorry aber ich habe nix gefunden.... !
Kann nicht jemand schnell nen beispiel schreiben, denn mit dem vergleichen welches item markiert ist hab ich noch net verstanden....

dankö
JayK
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1013



BeitragVerfasst: Mi 13.07.05 19:43 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.ComboBox1Change(Sender: TObject);
begin
  case ComboBox1.ItemIndex of
    0: // Tu was für erstes Item
    1: // Tu was für zweites Item
    ...
end;
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Mi 13.07.05 19:43 
Suche in: Delphi-Forum, Delphi-Library "COMBOBOX MARKIERT* ITEM" (dann musst du nurnoch den momentan 2. Treffer anklicken) :motz:

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
WormHole Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 145



BeitragVerfasst: Mi 13.07.05 20:34 
Sorry ich hatte alles mit "Combobox on Chance", "combobox on chance codebeispiel" etc ausprobiert....
Naja, danke trotzdem!

greetz der Worm
WormHole Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 145



BeitragVerfasst: Do 14.07.05 12:50 
Noch eine Frage:

mit dem case of habe ich alles verstanden, nur, der macht mir eine fehlermeldung wenn ich bei
ausblenden Quelltext
1:
2:
3:
4:
5:
case Combobox1.Itemindex of
0: Label1.Visible:=true;
   Label2.Visible:=false;
1: Label3.Visible:=true;
   Label4.Visible:=false;


mache! Warum?
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Do 14.07.05 13:00 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.ComboBox1Change(Sender: TObject);
begin
  if Combobox1.Itemindex = 0 then Label1.Visible:=true;
  if Combobox1.Itemindex = 0 then Label2.Visible:=false;
end;
WormHole Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 145



BeitragVerfasst: Do 14.07.05 13:05 
thx ;)
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Do 14.07.05 14:09 
Wenn du mit Case arbeiten willst, dann so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
case Combobox1.Itemindex of
0: begin
    Label1.Visible:=true;
    Label2.Visible:=false;
   end;
1: begin
    Label3.Visible:=true;
    Label4.Visible:=false;
   end;
end;


Gruß,
maxk

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.