Solved

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

Posted on 2006-07-17
5
190 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
  • 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 500 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

707 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

19 Experts available now in Live!

Get 1:1 Help Now