Solved

How do I hide the main form on start?

Posted on 1998-09-19
10
150 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
  • 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

929 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now