Autor Beitrag
firefuzy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 69

Win 98 SE, WinXP Prof, Vista HPrem.
Delphi 7
BeitragVerfasst: Mo 12.03.07 16:56 
Hallo allerseits!

Ich habe mal wieder ein Problem bei dem mir weder Google noch die SuFu weitergeholfen haben. Da das Problem in meinem Programm noch komplizierter ist versuche ich alles etwas vereinfacht zu beschreiben.

Und zwar will ich, dass wenn in Form1 auf den OK-Button geklickt wird der Inhalt von Edit1 (Preis von etw.) in einen String geschrieben wird (kein Problem), und dann Form2 sichtbar wird und dort auf Button-klick der Inhalt des dortvorhandenen Edits (Anzahl) auch in einen String von Form1 geschrieben wird. Dann soll die Prozedur die beiden Werte multiplizieren (kein Problem).

Das Problem ist nun, dass die Prozedur von Form1 angehalten werden muss bis der Benutzer in Form2 eine Eingabe gemacht hat und auf den OK-Button geklickt hat.
Hier Mal der Code bis jetzt:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
...
var Anzahl: String;
...
procedure TForm1.RechnePreis;
var Preis: String;
begin
Preis := Edit1.Text;
Form2.Visible := True;
//Hier mein Problem

Label1.Caption := FloattoStr(StrtoFloat(Preis) * StrtoInt(Anzahl));
end;

Ich nehme stark an, dass dieses Problem nicht zu kniffelig ist, da solche Situation recht häufig entstehen (denke ich :roll: ), deshalb hoffe ich auf eine schnelle Antwort.

MfG firefuzy
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mo 12.03.07 17:00 
ganz einfach:
ausblenden Delphi-Quelltext
1:
form2.showModal;					

_________________
In the beginning was the word.
And the word was content-type: text/plain.
firefuzy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 69

Win 98 SE, WinXP Prof, Vista HPrem.
Delphi 7
BeitragVerfasst: Mo 12.03.07 17:15 
Das ging ja sehr schnell! :D
Eine Frage noch:
Kann man eigentlich den Wert von Form2 auch direkt in die Prozedur übergeben, also ohne globale Variable?
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mo 12.03.07 17:47 
ja klar. du kannst dir ja den Eingabewert über form2.edit1.text auslesen.

_________________
In the beginning was the word.
And the word was content-type: text/plain.
firefuzy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 69

Win 98 SE, WinXP Prof, Vista HPrem.
Delphi 7
BeitragVerfasst: Mo 12.03.07 18:34 
Booahh bin ich blöd :autsch: :autsch: :autsch:
Mal wieder schneller gepostet als gedacht :oops: