?
Solved

How do I hide the main form on start?

Posted on 1998-09-19
10
Medium Priority
?
160 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 200 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month14 days, 4 hours left to enroll

807 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