Solved

How do I hide the main form on start?

Posted on 1998-09-19
10
152 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 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