Autor Beitrag
Wolle92
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Mo 18.06.07 11:18 
Wenn ich zwei Forms in ein Programm stecke, und dann vom das erste "Schließe" und das zweite "öffne", und dann das Fenster minimiere, dann geht das unten in die Ecke bei dem Start-Knopf, nicht in die Taskleiste... wie kann ich das ganze in die Tasklieste kriegen?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Button1Click(Sender: TObject);
begin
  Form2.Visible := true;
  Form1.Visible := false;
end;
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Mo 18.06.07 11:32 
ausblenden Delphi-Quelltext
1:
application.Minimize					

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Mo 18.06.07 11:36 
und wie soll ich das einbauen, wenn das formular minimiert wird?
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Mo 18.06.07 11:41 
user profile iconWolle92 hat folgendes geschrieben:
dann geht das unten in die Ecke bei dem Start-Knopf, nicht in die Taskleiste...

Hm... der Bereich neben dem Start-Button nennt sich Taskleiste. Oder meinst du den Bereich neben der "Uhr"?

Lg Martin

_________________
Ein Nutzer der Ecke ;-)
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Mo 18.06.07 11:44 
im OnMinimize der Form.
Falls es das nicht gibt (hab grad kein delphi zur Hand..nur Borland Pascal 7) nimmst du das ActionEvent und da gibt es sicher ein OnMinimize.

Das Problem was du hast liegt darin, dass du ein vom Hauptformular erzeugtes Fenster minimieren möchtest.
Deshalb wird eben dieses Fenster über den Startbutton "gesetzt".

Du kannst aber auch das OnMinimize-Ereignis dazu nutzen, um den Befehl deinem Hauptformular mitzugeben

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm2.OnMinimize(Sender: TObject);
begin;
 //Ich geh davon aus, dass Form1 dein Hauptformular ist
 Form1.OnMinimize(self);
end;


Welchen Sinn hat eigentlich das Verstecken des Hauptformulars?

LG
Stefan

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.


Zuletzt bearbeitet von ZeitGeist87 am Mo 18.06.07 14:52, insgesamt 1-mal bearbeitet
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Mo 18.06.07 11:51 
öhmmm... das Hauptformular ist die Startseite4, was mir grade sinnlos vorkommt...
Besser wäre wahrscheinlich:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
...
initialization

Form1.Visible := false;
Form2.Visible := true;
...


Und in Form2:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm2.Button1Click(Sender: TObject);
begin
  Form2.Visible := false;
  Form1.Visible := true;
end;

Natürlich uses nicht vergessen
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Mo 18.06.07 11:54 
ähh... doch nicht... funktioniert nicht, gibt nen Error
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Mo 18.06.07 11:58 
user profile iconMartin1966 hat folgendes geschrieben:
user profile iconWolle92 hat folgendes geschrieben:
dann geht das unten in die Ecke bei dem Start-Knopf, nicht in die Taskleiste...

Hm... der Bereich neben dem Start-Button nennt sich Taskleiste. Oder meinst du den Bereich neben der "Uhr"?

Lg Martin


Hab mich falsch ausgedrückt, "unten in die Ecke, über den Startknopf"
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Mo 18.06.07 13:09 
OK, so funktionierts auch nicht:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm2.FormCreate(Sender: TObject);
begin
  Form1.Visible := false;
  Form2.Visible := true;
end;

Kann mir jemand helfen?
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Mo 18.06.07 13:25 
Ja was soll da auch funktionieren??

Du setzt einfach nur die Sichtbarkeit deiner Forms hin und her!

nimm mal nen Button und leg ein application.Minimize rein!

Lg
Stefan

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Mo 18.06.07 13:29 
ne, jetzt will ich erstmal das ganze so einstellen, dass der Startbildschirm, auf dem nur der Name des Programms steht, nicht das Hauptformular ist, und trotzdem als erstes angezeigt wird... dann muss auch nix anderes da hin
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Mo 18.06.07 13:38 
Vieleicht sollte man sich vorm Begin des Projektes schon mal Gedanken machen.
Schau mal nach Splashscreen, da solltest Du hier einiges Finden.

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Mo 18.06.07 13:51 
Ich wundere mich grade, dass alles funktioniert, wenn ich in das erste Formular, das ja erst als zweites angezeigt werden soll, aber trotzdem das Hauptformular sein soll, einen Button setze und dem dann sage:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Button4Click(Sender: TObject);
begin
  TForm1.Visible := false;
  TForm2.Visible := true;
end;


Ich will das ja aber nicht erst mit nem Button machen, sondern sofort beim start...
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Mo 18.06.07 14:05 
user profile iconWolle92 hat folgendes geschrieben:
Ich wundere mich grade, dass alles funktioniert, wenn ich in das erste Formular, das ja erst als zweites angezeigt werden soll, aber trotzdem das Hauptformular sein soll, einen Button setze und dem dann sage:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Button4Click(Sender: TObject);
begin
  TForm1.Visible := false;
  TForm2.Visible := true;
end;


Ich will das ja aber nicht erst mit nem Button machen, sondern sofort beim start...


Ja warum soll das nicht funktionieren?
Ich steig da grad nicht durch!

Schnapp dir ne Form, die dein Splashscreen sein soll (NICHT DIE MAINFORM)!

Dann editier die Projektfile so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
program Project1;

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit2.pas' {Form2};

{$R *.res}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TForm2, Form2);
  application.ShowMainForm:= false;
  //Splashscreen zeigen
  form2.show;
  sleep(10000);
  form2.Close;
  application.ShowMainForm:= true;
  Application.Run;
end.

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Mo 18.06.07 14:09 
Kann man das statt sleep auch so einstellen, dass es wirklich erst dann weitergeht, wenn der User den Button geklickt hat?

Bei mir gibts kein Sleep, und Form2 erkennt der auch nicht
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Mo 18.06.07 14:20 
OK, erkennt er doch, aber wenn ich dann Show mache, dann sehe ich zwar das Fenster, aber machen kann man damit nichts...
Das soll aber so sein... Außerdem sieht man die Komponenten darauf nicht
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Mo 18.06.07 14:40 
form2.refresh;

das mit dem Button kannst du ganz einfach in deiner Form2 lösen

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure weiterBtn.OnClick(Sender: TObject);
begin;
 form2.close;
 application.showmainform:= true;
end;


sleep(); kannst du dann natürlich weglassen :)

LG
Stefan

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Mo 18.06.07 14:43 
Naja, wenn ich sleep weglasse, gehts doch sofort weiter...
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Mo 18.06.07 14:51 
OK, habs mit
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TForm2, Form2);
  Application.ShowMainForm := false;
  Form2.Show;
  Form2.Refresh;
  Application.Run;
end.

und
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm2.Button1Click(Sender: TObject);
begin
  Form2.Hide;
  Application.ShowMainForm := true;
  Form1.Show;
end;

hingekriegt... danke!!!
Das muss gefeiert werden... :beer:
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Mo 18.06.07 14:51 
Du hast was zwischen den Schultern..
Weißt schon..das Ding, wo links und rechts Ohren sind..
Genau..dein Kopf! Mitdenken!!!

ausblenden Delphi-Quelltext
1:
2:
form2.close;
application.showMainform:= true;


weglassen und das in Form2 bei ButtonClick abhandeln!

LG
Stefan

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.