?
Solved

How to change the default form that Delphi starts with? Can it be done, or not?

Posted on 2006-07-17
5
Medium Priority
?
204 Views
Last Modified: 2010-04-16
Hi all

Can the default form that Delphi starts with be changed, if so, how, if not then just a simple no will solve my question too, thxxxx


Fdehell
0
Comment
Question by:fdehell
[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
  • 3
  • 2
5 Comments
 
LVL 26

Expert Comment

by:Russell Libby
ID: 17124168

Are you talking the IDE, or an application that you are working on (its unclear)?  If talking about an app, then yes, but you have to do it in the project source. The main form is determined by the first form that the application creates.

Russell

Example that switches the main form based on passing a command line param of "FORM2".

program Project2;

uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit2.pas' {Form2};

{$R *.RES}

begin
  Application.Initialize;
  if (ParamStr(1) = 'FORM2') then
  begin
     Application.CreateForm(TForm2, Form2);
     Application.CreateForm(TForm1, Form1);
  end
  else
  begin
     Application.CreateForm(TForm1, Form1);
     Application.CreateForm(TForm2, Form2);
  end;
  Application.Run;
end.
0
 
LVL 1

Author Comment

by:fdehell
ID: 17124386
Well I am talking about the Delphi IDe, i mean, just when you start Delphi, it creates a main form, that always for instance has the same icon, which i dont like, and so i always have to change it myself every time AFTER i start delphi, i was kinda wondering where the default form was stored in which directory etc, but then i reckon one cannolt change the default form that delphi starts with, prior before Delphi starts? I mean, it would have been a blast if delphi would start with MY icon instead of the standard delphi icon...

Working with your code now Russel, thx heaps

Frank
0
 
LVL 26

Accepted Solution

by:
Russell Libby earned 2000 total points
ID: 17124536
Frank,

You can use the Object Repository in the IDE to create a new project, add the project to the repository, then set the project as the default to use when you select File | New Application. There are a number of options available, so rather than go into detail on it, check out the help for the "Object Repository" and let us know if you have question / difficulties.

Russell
0
 
LVL 1

Author Comment

by:fdehell
ID: 17124705
Strangely enough i was working with a new form and it suddenly displayed my own icon haha, apart from this, i have done what you said Russel, and voila problem fixed thx heaps Russel

Frank
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 17124737
Very welcome,

Russell
0

Featured Post

Independent Software Vendors: 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

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…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month12 days, left to enroll

752 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