• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 220
  • Last Modified:

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

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
fdehell
Asked:
fdehell
  • 3
  • 2
1 Solution
 
Russell LibbySoftware Engineer, Advisory Commented:

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
 
fdehellAuthor Commented:
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
 
Russell LibbySoftware Engineer, Advisory Commented:
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
 
fdehellAuthor Commented:
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
 
Russell LibbySoftware Engineer, Advisory Commented:
Very welcome,

Russell
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now