Autor Beitrag
SuperS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 102

Win XP Home, Win XP Prof, Win 98

BeitragVerfasst: Fr 20.02.04 21:01 
Wie kann ich, wenn ich in einer ComboBox befehle drin habe, sie programmieren?
Also ich meine es so:
wenn ich das Project starte und bei der ComboBox das DropDown Menu wähle und einen eintrag anklicke, dass ein Efekt wie z.B dass sich eine neue Form öffnet in kraft tritt. :D
ErnestoChe
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 528

Win 2000 pro, CRUX 2.0
Delphi 6 Pers, Open K3
BeitragVerfasst: Fr 20.02.04 21:17 
Hallo,

einfach mit dem OnChange-Ereigniss der ComboBox arbeiten. Den Index des Eintrags abfragen und darauf reagieren:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
procedure TForm1.ComboBox1Change(Sender: TObject);
begin
  case ComboBox1.ItemIndex of
    0:
      Form2.Show;
    1:
      Form3.Show;
    2:
      MachDies;
    3:
      MachJenes;
  end;
end;


MFG

- Ernesto -
SuperS Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 102

Win XP Home, Win XP Prof, Win 98

BeitragVerfasst: Fr 20.02.04 21:32 
:D Thanks for the code :D