Solved

How do I hide the main form on start?

Posted on 1998-09-19
10
154 Views
Last Modified: 2010-04-06
Based on a command line param I want to be able to hide the main form before it shows itself on start. How can this be done? I've tried to do frmMain.Hide in OnCreate and it doesn't seem to work.

Thanks
0
Comment
Question by:ripcord
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 4

Expert Comment

by:erajoj
ID: 1340302
Hi,
In Delphi 3+, just do this:
  Application.ShowMainForm := False;

/// John

0
 
LVL 3

Expert Comment

by:Matvey
ID: 1340303
-Also, based on command line parameters, you could add a line to the DPR file:

Application.... ( mainform, ... );
if paramstr( N ) = '...' then mainform.hide;
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1340304
-Also, based on command line parameters, you could add a line to the DPR file:

Application.... ( mainform, ... );
if paramstr( N ) = '...' then mainform.hide;
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Expert Comment

by:erajoj
ID: 1340305
Happy trigger finger?

/// John
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1340306
Heh, more coffee should help :-)
0
 

Expert Comment

by:sakya
ID: 1340307
Hello.

This is a sample.

----------------------------------------
procedure TForm1.FormCreate(Sender: TObject);
begin
     Application.ShowMainForm := False;

     
     ShowMessage('Hello');// <-you write your procedure here


     Form1.Show;
end;
---------------------------------------

Application.ShowMainForm is written before Application.Run.
So, you can write Application.ShowMainForm in the OnCreate.

And when you want to display  the Main Form, use 'Show'.

sakya
0
 

Author Comment

by:ripcord
ID: 1340308
thanks for the help, someone answer the question for credit. All your answers worked.
0
 
LVL 4

Expert Comment

by:erajoj
ID: 1340309
Since it is election day here in Sweden and since Matvey has posted the majority of the comments, he should have the credit, all in the spirit of democracy.
Matvey, don't be shy!

/// John
0
 

Expert Comment

by:sakya
ID: 1340310
Hello.

I agree with erajoj.

sakya
 
0
 
LVL 3

Accepted Solution

by:
Matvey earned 50 total points
ID: 1340311
Again? :) I'm blushing...

Thanks my friends friends, I really receive lots of gifts for the Hebrew new year! BTW greetings to all of you!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Using idhttp to login to instagram 2 118
LAN or WAN ? 11 106
tidtcpserver connection lost handle 2 110
How to save the image in the .cds File ClientDataSet? 1 31
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question