![]() |
Re: procedure nach Application.run
Hallo,
Zitat:
Delphi-Quellcode:
Damit hat das Programm wahlweise das Hauptformular oder das Nebenformular als MainForm. Wenn ich die Fragestellung recht verstanden habe, ist genau das gewünscht. Wenn der erste Parameter = open, dann ist das Nebenformular anzuzeigen und das Hauptformular zu verstecken, andernfalls ist das Hauptformular als MainForm zu nutzen und das Nebenformular zu verstecken. Verstecken ist hier gleichbedeutend mit: "Wird nicht benötigt" und daher in diesem Beispiel auch nicht erstellt.
program Project1;
uses Forms, Unit1 in 'Unit1.pas' {Hauptformular}, Unit2 in 'Unit2.pas' {Nebenformular}; {$R *.res} begin Application.Initialize; If ParamStr(1) = 'open' then begin Application.CreateForm(TNebenformular, Nebenformular); end else begin Application.CreateForm(THauptformular, Hauptformular); end; Application.Run; end. |
Re: procedure nach Application.run
Ja, versucht habe ich das
Delphi-Quellcode:
auch schon, aber sobald ich mit 'if' arbeite kommt die Meldung:
begin
Application.Initialize; If ParamStr(1) = 'open' then begin Application.CreateForm(TNebenformular, Nebenformular); end else begin Application.CreateForm(THauptformular, Hauptformular); end; Application.Run; end. 'Der Aufruf von Application.CreateForm fehlt oder ist nicht korrekt!' Evtl. liegt das ja auch an meiner Delphiversion (D5). |
Re: procedure nach Application.run
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:19 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-2025 by Thomas Breitkreuz