Solved

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

Posted on 2006-07-17
5
198 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

808 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