Thema: Delphi Delphi- Combobox

Einzelnen Beitrag anzeigen

Carter

Registriert seit: 10. Jul 2009
4 Beiträge
 
#13

Re: Delphi- Combobox

  Alt 10. Jul 2009, 17:34
Das war mein anfänglicher Quellcode:

Delphi-Quellcode:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    ComboBox1: TComboBox;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Label4: TLabel;
    Label5: TLabel;
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button3Click(Sender: TObject);
begin
close;
end;

procedure TForm1.Button2Click(Sender: TObject);
var a,b,c:integer;
begin

a:=strtoint(combobox1.Text);
b:=strtoint(edit1.Text);
c:=a*b;

edit2.Text:=inttostr(c)

end;

end.

Nun siehts so aus, weil ich schon wieder viel gelöscht habe, weil es einfach nicht funzte:

Delphi-Quellcode:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
  TMyClass = class
    GroupBox1: TGroupBox;
    ComboBox1: TComboBox;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Label4: TLabel;
    Label5: TLabel;
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    FBezeichnung: string;
    FZahl: integer; { Private-Deklarationen }
  public
    property Bezeichnung: string read FBezeichnung write FBezeichnung;
    property Zahl: integer read FZahl write FZahl; { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button3Click(Sender: TObject);
begin
close;
end;

procedure TForm1.Button2Click(Sender: TObject);
var a,b,c:integer;
begin

a:=strtoint(combobox1.Text);
b:=strtoint(edit1.Text);
c:=a*b;

edit2.Text:=inttostr(c)

end;

end.
Du hast eine Procedure vorhins geschrieben, wo soll ich die hinmachen? Einfach nur reinschreiben? Das hat ich vorhins auch und es hat dennnoch nicht geklappt...
  Mit Zitat antworten Zitat