|
Try
something like this:
1).
Create an empty form to be your main form (TEmptyMain);
2). Set property values for both TEditMain and
TMainForm as following:
BorderStyle = bsNone
Align = alClient
3).
Change your code to this:
Application.CreateForm(TEmptyMain, EmptyMain);
if
FindCmdLineSwitch('e',['-','/'],True) then
begin
EditMain :=
TEditMain.Create(Application);
EditMain.Parent :=
EmptyMain; end else begin
MainForm :=
TMainForm.Create(Application);
MainForm.Parent :=
EmptyMain;
end;
HTH
Cheng
Hi
Via a command-line switch, I want to display a
different form when the program starts, rather than the mainform. I've
tried hiding the mainform and showing the other form in the OnShow method of
the mainform but it doesn't allow this. Visible can't be altered in an
OnShow. I tried editing the DPR to create the first form in a different
order as follows but this crashes Delphi 5 and I can't even load it. I
had to alter it back in Notepad.
if
FindCmdLineSwitch('e',['-','/'],True) then
Application.CreateForm(TEditMain, EditMain) else
Application.CreateForm(TMainForm, MainForm);
Any other suggestions?
--- Incoming mail is certified Virus Free. Checked by
AVG anti-virus system (http://www.grisoft.com). Version: 6.0.545 / Virus
Database: 339 - Release Date: 27/11/2003
This e-mail message has been scanned for Viruses and Content and cleared by
MailMarshal -
For more information please visit
www.marshalsoftware.com
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27/11/2003
|
_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi