Autor Beitrag
mikeyboy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 96

WIN XP
D6 Pers
BeitragVerfasst: Di 07.12.04 10:25 
Hallo

ich würde gern eine kleines Programm schreiben dass z.B. dei Frage Schreibt wie alt sind Sie und dann je nach Auswahl/Eingabe dann eine bestimmte Antwort zeigt! Ich würde es mit ComboBox und Labels (Visible funktion) machen!
Wie würdet Ihr so etwas machen??
Aber ich bin Anfänger :oops: also bitte keine hochkomplizierten Varianten! :twisted:

Danke im Vorraus!!

LG mike
st-matze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 138

Win 3.11, Win 95, Win 98, Win XP
D7 Ent, D6 Pers, (D5 Pers)
BeitragVerfasst: Di 07.12.04 11:36 
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    CBAuswahl: TComboBox;
    LblFrage: TLabel;
    LblAntwort: TLabel;
    procedure FormCreate(Sender: TObject);
    procedure CBAuswahlChange(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  LblFrage.Caption:='Wie alt sind sie?';
  LblAntwort.Caption:='';
  CBAuswahl.Style:=csDropDown;
  CBAuswahl.Text := 'Bitte wählen';
  CBAuswahl.Items.Add('< 20');
  CBAuswahl.Items.Add('20-40');
  CBAuswahl.Items.Add('> 40');
end;

procedure TForm1.CBAuswahlChange(Sender: TObject);
begin
  case CBAuswahl.ItemIndex of
  0:LblAntwort.Caption:='Jungspunt';
  1:LblAntwort.Caption:='no comment.';
  2:LblAntwort.Caption:='Alter Sack!'
  else
    LblAntwort.Caption:='';
  end;
end;

end.
mikeyboy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 96

WIN XP
D6 Pers
BeitragVerfasst: Di 07.12.04 15:24 
Ich danke dir, du hast mir sehr geholfen! Lieb von dir! :) :D