Hi,
im Grunde läuft dein Ansatz ja auf folgendes heraus:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7:
| procedure TForm.Button1Click(Sender: TObject); begin if WaitForm.canFocus then WaitForm.Show; FUNCTOINS; Form2.Close; end; |
Das hat jetzt auch wunderbar geklappt - das Problem scheint wohl zu sein, wenn ich WaitForm.ShowModal aufrufe - anstelle von WaitForm.Show;
Bei ShowModal ruft er das Fenster modal auf, dann wartet er und erst wenn ich das Fenster schließe werden die Functions ausgelöst.
Wie schaffe ich es nun, dass das Fenster trotzdem modal ist - eine Möglichkeit wäre folgende:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9:
| procedure TForm.Button1Click(Sender: TObject); begin Enabled := False; if WaitForm.canFocus then WaitForm.Show; FUNCTOINS; Form2.Close; Enabled := True; end; |
Gibt es da noch n' elegantere Möglichkeit?
Stefan