Autor Beitrag
fishhed
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77


Delphi 7
BeitragVerfasst: Do 05.04.07 09:39 
Hallo Gemeinde,

wenn ich neue Formular in mein Programmm einfüge, dann wird dieses automatisch als Hauptformular festgelegt. Bei nächsten Öffnen des Projektes wird es automatisch als erstes angezeigt. Nun möchte ich aber wieder mein vorheriges Hauptformular zurück!

Unter "Projekt --> Option --> Formular --> Hauptformular" kann ich aber nur das neue Formular auswählen.

Was mache ich falsch?
freak4fun
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 604
Erhaltene Danke: 4

Win 7 Pro
VS 2013 Express, Delphi, C#, PHP, Java
BeitragVerfasst: Do 05.04.07 09:44 
Ist das bei allen Projekten so, oder nur bei dem speziellen? Sehr merkwürdiges problem ...

_________________
"Ich werde auf GAR KEINEN Fall…!" - "Keks?" - "Okay, ich tu's."
i++; // zaehler i um 1 erhoehen
Sinspin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1335
Erhaltene Danke: 118

Win 10
RIO, CE, Lazarus
BeitragVerfasst: Do 05.04.07 10:19 
Das ist wirklich seltsam. Leitest du dein Formular von TForm ab oder von einer anderen Klasse?
Das Hauptformular ist immer das erste in einer Anwendung erzeugte. Das heißt du änderst immer nur die Erstellungsreihenfolge. Und wo geht das bessern als im Hauptprogramm? Mit Projekt / Quelltext anzeigen, wird dir dein Hauptprogramm (*.dpr) geöffnet. Nun werden darin via:
ausblenden Delphi-Quelltext
1:
    Application.CreateForm("Klassen name", "instanz");					

deine Formulare erstellt.
Vertausche einfach die Aufrufe nun so, das als erstes, das Fenster erzeugt wird das zu als Hauptfenster haben willst.

_________________
Wir zerstören die Natur und Wälder der Erde. Wir töten wilde Tiere für Trophäen. Wir produzieren Lebewesen als Massenware um sie nach wenigen Monaten zu töten. Warum sollte unser aller Mutter, die Natur, nicht die gleichen Rechte haben?
fishhed Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77


Delphi 7
BeitragVerfasst: Do 05.04.07 10:26 
Nein, es tritt nur bei einem Projekt auf.

Hier mal der Quelltext des Projekts (.dpr). Ist hier was falsch? Ich habe ein wenig daran verändert und rumprobiert.

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
program Projekt;

uses
  Forms,
  datum,
  DebugUnit,
  configmain,
  debugform,
  tools,
  srequest,
  splashscreen,
  sourcemodules,
  statewindowmain,
  newupdate,
  updatedll,
  dllversion,
  aboutmain,
  address,
  newinternaldb,
  Base64,
  configtables,
  webinfo,
  supportunit,
  contactform,
  licenceunit,
  regform,
  buyed,
  aktualisierung_start_meldung,
  beendenscr,
  suchauftrag_loeschen_form,
  datenbankueberschreiben,
  ocr_autoscout24,
  uVertragVorverarbeitung,
  trmemo in 'trmemo.pas',
  uLizenzAbgelaufen in 'uLizenzAbgelaufen.pas' {frmLizenzAbgelaufen},
  main;

//in 'D:\Delphi\XY Code\xxxxx.pas' {Form4};

{$R *.res}

begin
  Application.Initialize;
  Application.Title := 'Titel';
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TDatumsForm, DatumsForm);
  Application.CreateForm(TEinstellungForm, EinstellungForm);
  Application.CreateForm(TForm3, Form3);
  Application.CreateForm(TStartForm, StartForm);
  Application.CreateForm(TModuleStateWindow, ModuleStateWindow);
  Application.CreateForm(TFormAbout, FormAbout);
  Application.CreateForm(TAddressForm, AddressForm);
  Application.CreateForm(TWebInfoForm, WebInfoForm);
  Application.CreateForm(TContactErrorForm, ContactErrorForm);
  Application.CreateForm(TLicenceForm, LicenceForm);
  Application.CreateForm(TRegisterForm, RegisterForm);
  Application.CreateForm(TBuyedForm, BuyedForm);
  Application.CreateForm(TAutoAktualisierungForm, AutoAktualisierungForm);
  Application.CreateForm(TTerminateWaitForm, TerminateWaitForm);
  Application.CreateForm(TSuchauftragLoeschenForm, SuchauftragLoeschenForm);
  Application.CreateForm(Tdatenbankueberschreibenform, datenbankueberschreibenform);
  Application.CreateForm(TForm4, Form4);
  Application.CreateForm(TfrmVertragsDaten, frmVertragsDaten);
  Application.CreateForm(TfrmLizenzAbgelaufen, frmLizenzAbgelaufen);
  Application.Run;
end.
fishhed Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77


Delphi 7
BeitragVerfasst: Do 05.04.07 10:31 
user profile iconSinspin hat folgendes geschrieben:
Vertausche einfach die Aufrufe nun so, das als erstes, das Fenster erzeugt wird das zu als Hauptfenster haben willst.


Das habe ich auch schon mehrmals gemacht (Siehe Quelltext oben). Vor ein paar Tagen ging es auch noch.
Jezt aber auf einmal nicht mehr :-(
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Do 05.04.07 10:32 
Unter Projekt -> Optionen einfach unter Formulare die Erstellungsreihenfolge und dein Hauptformular anpassen ...

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Do 05.04.07 10:38 
user profile iconBenBE hat folgendes geschrieben:
Unter Projekt -> Optionen einfach unter Formulare die Erstellungsreihenfolge und dein Hauptformular anpassen ...

(a) Ja
(b) ich würde nur das Hauptformular erstellen, alle anderen erst wenn sie gebraucht werden:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
proceudre TMainForm.Button1Click(sender: TObject);
var
  F: TFormZwei;
begin
  Application.CreateForm(TFormZwei,F);
  F.Showmodal; // o.ä.
  F.Free;
end;

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
freak4fun
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 604
Erhaltene Danke: 4

Win 7 Pro
VS 2013 Express, Delphi, C#, PHP, Java
BeitragVerfasst: Do 05.04.07 10:39 
Hast du mal versucht die Reihenfolge im Quelltext zu ändern?

_________________
"Ich werde auf GAR KEINEN Fall…!" - "Keks?" - "Okay, ich tu's."
i++; // zaehler i um 1 erhoehen
fishhed Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77


Delphi 7
BeitragVerfasst: Do 05.04.07 10:39 
user profile iconBenBE hat folgendes geschrieben:
Unter Projekt -> Optionen einfach unter Formulare die Erstellungsreihenfolge und dein Hauptformular anpassen ...


Das habe ich schon versucht und es funktioniert nicht. Das ist ja das Problem...
Unter Hauptformular kann ich nur ein einziges Formulare (das letzte) auswählen.

Unter "Automatisch erzeugen" steht meine Hauptformular oben.
iKilledKenny
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 394
Erhaltene Danke: 8

Win XP
D5 Prof, C# Express 2005
BeitragVerfasst: Do 05.04.07 10:50 
Da ich ein englisches Delphi habe, kann ich dirs leider nur auf Englisch sagen:

Unter ->Tools->Environment Options->Prefrences findet sich ein "Auto create forms". Den Haken musst du wegnehmen.
fishhed Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77


Delphi 7
BeitragVerfasst: Do 05.04.07 16:45 
user profile iconiKilledKenny hat folgendes geschrieben:
Da ich ein englisches Delphi habe, kann ich dirs leider nur auf Englisch sagen:

Unter ->Tools->Environment Options->Prefrences findet sich ein "Auto create forms". Den Haken musst du wegnehmen.


Warum? Und was passiert denn dann?

Das Problem tritt ja nur bei einem Projekt auf und nicht bei allen, deshalb kann ich mir nicht vorstellen, dass es was nützt, an den Einstelleungen der Umgebung rumzuschrauben.
HelgeLange
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 735
Erhaltene Danke: 6

Windows 7
Delphi7 - Delphi XE
BeitragVerfasst: Do 05.04.07 17:12 
Du solltest eh die ganzen forms nicht automatisch beim Start erzeugen lassen, sondern nur Dein Hauptformular, alle anderen dynamisch, wenn sie benötigt werden. Das verringert die Ladenzeit erheblich und spart Speicher :) oh.. und es löst Dein Problem auch noch...

_________________
"Ich bin bekannt für meine Ironie. Aber auf den Gedanken, im Hafen von New York eine Freiheitsstatue zu errichten, wäre selbst ich nicht gekommen." - George Bernhard Shaw
IngoD7
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 629


D7
BeitragVerfasst: Do 05.04.07 17:49 
user profile iconfishhed hat folgendes geschrieben:
Unter Hauptformular kann ich nur ein einziges Formulare (das letzte) auswählen.


Folgende Projektdatei:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
program Project1;

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

{$R *.res}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TForm2, Form2);
  Application.CreateForm(TForm3, Form3);
  Application.Run;
end.


Wie man sieht, sind es drei Forms. Form2 taucht aber in den Projektoptionen nicht zur Auswahl zum Hauptformular auf, weil seine "Bemerkung" unter uses fehlt.

Ich würde also erstmal schauen, ob unter uses alle (Form-)Units (und vor allem die Hauptform-Unit!) in der Art
ausblenden Delphi-Quelltext
1:
Unit3 in 'Unit3.pas' {Form3};					

auftauchen.