Entwickler-Ecke

Grafische Benutzeroberflächen (VCL & FireMonkey) - Form2 soll zuerst gestartet werden?


zero_cool1986 - Mo 24.10.05 22:43
Titel: Form2 soll zuerst gestartet werden?
hi, ich hab mal ne Frage ich habe 2 Formen Form1 und Form2 aber ich möchte das beim starten zuerst Form2 erscheint wie mach ich das? bin dankbar für hilfe mfg Daniel


Amateur - Mo 24.10.05 22:47

naja im onactivate des form1 dieses verstecken mit form1.hide und gleichzeitig form2.show... so würde ich das machen weiss aber nicht ob das funktioniert...


zero_cool1986 - Mo 24.10.05 22:51

neee ok du hab schon trotzdem danke


Blackheart666 - Mo 24.10.05 23:12

Probiers mal so !


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:
var
  Form1: TForm1;

implementation

uses Unit2;

{$R *.dfm}

begin
  Application.Initialize;
  Form2:=TForm2.create(application);
  Application.CreateForm(TForm2, Form2);
  Application.CreateForm(TForm1, Form1);
  Application.Run;
  Form2.free;
  Application.Run;
end.

{<--------------------------------------------------------------------->}

var
  Form2: TForm2;

implementation

uses Unit1;

{$R *.dfm}

procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
 Form1.ShowModal;
end;

end.


VT - Mo 24.10.05 23:16

also man kann doch in den projektoptionen das hauptformular einstellen. setzt du also einfach auf 2.