AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Sonstige Fragen zu Delphi Nur das größte Ergebnis wird angegeben (Rechner mit Checkbox und Radiobox)
Thema durchsuchen
Ansicht
Themen-Optionen

Nur das größte Ergebnis wird angegeben (Rechner mit Checkbox und Radiobox)

Ein Thema von ItsMe1 · begonnen am 1. Feb 2013 · letzter Beitrag vom 2. Feb 2013
 
ItsMe1

Registriert seit: 31. Jan 2013
15 Beiträge
 
#1

Nur das größte Ergebnis wird angegeben (Rechner mit Checkbox und Radiobox)

  Alt 1. Feb 2013, 18:14
Hey Leute,
ich hab noch eine Frage...
Ich möchte gerne das mein "Taschenrechner" die Editfelder mit dem dazugehörigen Hacken in der Checkbox addiert.
Mein Problem ist es das immer nur zwei zahlen zusammengerechnet werden oder halt nicht nur die wo ein hacken in der Checkbox ist ....
Hier der Code:
Code:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    CheckBox1: TCheckBox;
    CheckBox2: TCheckBox;
    CheckBox3: TCheckBox;
    CheckBox4: TCheckBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Edit4: TEdit;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    Button1: TButton;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button2Click(Sender: TObject);
begin
  if radiobutton1.Checked = true and Checkbox1.Checked = true and Checkbox2.Checked =true then
    begin
      label7.Caption:= floattostr(strtofloat(edit1.Text)+strtofloat(edit2.Text));
    end;

  if radiobutton1.Checked = true and checkbox1.Checked =true and checkbox3.Checked =true then
    begin
      label7.caption:= floattostr(strtofloat(edit1.Text)+strtofloat(edit3.Text));
    end;

  if radiobutton1.Checked = true and Checkbox1.Checked = true and Checkbox4.Checked =true then
    begin
      label7.Caption:= floattostr(strtofloat(edit1.Text)+strtofloat(edit4.Text));
    end;

  if radiobutton1.Checked = true and checkbox2.Checked =true and checkbox3.Checked =true then
    begin
      label7.caption:= floattostr(strtofloat(edit2.Text)+strtofloat(edit3.Text));
    end;

  if radiobutton1.Checked = true and Checkbox2.Checked = true and Checkbox4.Checked =true then
    begin
      label7.Caption:= floattostr(strtofloat(edit2.Text)+strtofloat(edit4.Text));
    end;

  if radiobutton1.Checked = true and checkbox3.Checked =true and checkbox4.Checked =true then
    begin
      label7.caption:= floattostr(strtofloat(edit3.Text)+strtofloat(edit4.Text));
    end;

  if radiobutton1.Checked = true and Checkbox1.Checked = true and Checkbox2.Checked =true and Checkbox3.Checked =true then
    begin
      label7.Caption:= floattostr(strtofloat(edit1.Text)+strtofloat(edit2.Text)+strtofloat(edit3.Text));
    end;

  if radiobutton1.Checked = true and checkbox1.Checked =true and checkbox3.Checked =true and Checkbox4.Checked =true then
    begin
      label7.caption:= floattostr(strtofloat(edit1.Text)+strtofloat(edit3.Text)+strtofloat(edit4.Text));
    end;

  if radiobutton1.Checked = true and Checkbox4.Checked = true and Checkbox2.Checked =true and Checkbox3.Checked =true then
    begin
      label7.Caption:= floattostr(strtofloat(edit4.Text)+strtofloat(edit2.Text)+strtofloat(edit3.Text));
    end;

  if radiobutton1.Checked = true and checkbox1.Checked =true and checkbox2.Checked =true and Checkbox3.Checked =true and Checkbox4.Checked =true then
    begin
      label7.caption:= floattostr(strtofloat(edit1.Text)+strtofloat(edit2.Text)+strtofloat(edit3.Text)+strtofloat(edit4.Text));
    end;



end;

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

end.
Vielen Dank schon mal für die Hilfe
Grüße ItsMe1
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:39 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz