Autor Beitrag
ski20
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48



BeitragVerfasst: Fr 19.10.07 12:58 
Hi all

wie kann ich der Windowstate von minimert zu Maximiert ....zu laufzeit ? Meine Prog. wird gestartet minimiert und bei eine ereigniss soll es maximieren.

Danke

Ski


Moderiert von user profile iconNarses: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am Fr 19.10.2007 um 14:01
Stefan-W
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: Fr 19.10.07 13:16 
Hi, das Form selbst hat doch diese Funktion... soweit ich weis. wenn du da den Zustand der Form-Variable änderst, müsste das Form seine Größe ändern. Soweit ich das weis.

Hoffe geholfen zu haben
Tschau Stefan
ski20 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48



BeitragVerfasst: Fr 19.10.07 15:00 
Titel: wsMaximiert zu laufzeit ?
Hi,

meinst du das es gar nicht geht mit der haupt Form ??

Ski
Alpha_Wolf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 297

Ubuntu, Win XP, Win Vista
C#, Delphi 6 Prof, Delphi 2007 Prof, Java
BeitragVerfasst: Fr 19.10.07 15:11 
Natürlich geht es mit der Hauptform..

Für den Beispielcode benötigst du einen Button und einen Timer auf der Form:
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:
...
type
  TForm1 = class(TForm)
    Timer1: TTimer;
    Button1: TButton;
    procedure Timer1Timer(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  Timer1.Interval := 3000;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Self.WindowState := wsMinimized;
  Timer1.Enabled := true;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Self.BringToFront;
  Self.WindowState := wsMaximized;
  Timer1.Enabled := false;
end;

end.
...

Wenn das Programm startet, dann auf den Button klicken.. 3 sek. warten und tada da ist sie wieder.. ;)

_________________
Diskutiere nie mit einem Irren - er zieht dich auf sein Niveau und schlägt dich mit seiner Erfahrung.
Stefan-W
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 475

Win 7 SP1
D2005 PE
BeitragVerfasst: Fr 19.10.07 15:32 
Genau das, was hier so schön als Beispiel verpackt kam, hab ich gemeint.
ski20 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48



BeitragVerfasst: Fr 19.10.07 19:42 
Titel: wsMaximieren
Danke für das !! da ich das Fenster beim program start direkt MINIMIERT haben wollte, hab ich die code hinter der Button im Form1.oncreate getan. So wurde ncah 3 sec das fenster NICHT wieder maximiert !! (das problem was ich eigentlich hätte). Aber hab deine beispiel genommen und eine 2. timer ins Form1.oncreate getan die das Fenster nach 1 sec MINIMIERT (sieht auch gut aus :-)) ) danach MAXIMIERT das Fenster OK wenn meine ereigniss auslöst.

Danke ...have a nice weekend
Ski