Autor Beitrag
schitho
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 288

XP Home SP2
D2005 Prof
BeitragVerfasst: Mo 01.09.03 21:51 
Hi,

in Abhängigkeit, ob dem Programm ein Parameter übergeben wird, möchte ich das Hauptfenster verstecken und stattdessen ein anderes Fenster anzeigen lassen.

Mit Application.ShowMainForm:=false kann ich im OnCreate-Ereignis das Hauptfenster verstecken. Aber wie kann ich stattdessen ein anderes Fenster anzeigen lassen? Mit Form2.show im OnCreate-Block bekomm ich nur eine Fehlermeldung (Exception). :cry:

_________________
(Sorry! Leider ewiger Delphi-Neuling)
Ex0rzist
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 550

Win XP Prof.
Mandrake 10.0

D6
BeitragVerfasst: Di 02.09.03 00:07 
Hi,

du musst die zweite Form erst erstellen.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.FormCreate(Sender: TObject);
begin
Application.ShowMainForm := False;
Form2 := TForm2.Create(self);
If Form2 <> nil then
 Form2.Show;
end;

_________________
If accidentally read, induce vomitting.
schitho Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 288

XP Home SP2
D2005 Prof
BeitragVerfasst: Di 02.09.03 15:55 
Danke! :P

Werde ich ausprobieren.

_________________
(Sorry! Leider ewiger Delphi-Neuling)
recall
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 449



BeitragVerfasst: Fr 05.09.03 12:33 
einfach in der Entwurfszeit im Objekt insp. die Eigenschaft Visible der Form2 auf True setzen. Geht einfacher ;) .

Viele Grüsse.