Autor Beitrag
stigge
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: Mo 30.04.07 09:50 
Ich hab mal eine Frage zum Fensterrand:

Ich will, das mein Programm alle Funktionen hat außer das es nicht maximierbar ist.
Jetzt hab ich schon eine Weile rumprobiert aber es klappt nicht.
Wenn ich z.B. den Borderstyle auf bssingle setze und bei bordericons bimaximize deaktiviere, dann minimiert sich das Programm nicht mehr in die Taskleiste sondern links unten in den Desktop.

Gibt es denn keine Möglichkeit?


Moderiert von user profile iconGausi: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am Mo 30.04.2007 um 10:53
gasto
Hält's aus hier
Beiträge: 6

Windows XP SP2, Suse Linux 10
Delphi 7 Pro
BeitragVerfasst: Mo 30.04.07 14:13 
CreateParams überschreiben.
Hab Dir mal ein neues Projekt gemacht, da siehst Du wie genau es funktioniert.
Der Max Button ist dann deaktiviert, dennoch ist das minimieren normal möglich.

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:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TForm1 = class(TForm)
  private
    procedure CreateParams(var Params: TCreateParams); override;
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

{ TForm1 }

procedure TForm1.CreateParams(var Params: TCreateParams);
begin
  inherited;
  Params.Style := Params.Style And Not WS_MAXIMIZEBOX ;
end;

end.
stigge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 426

WinXP
Delphi 2007
BeitragVerfasst: Mo 30.04.07 16:21 
user profile icongasto hat folgendes geschrieben:
CreateParams überschreiben.
Hab Dir mal ein neues Projekt gemacht, da siehst Du wie genau es funktioniert.
Der Max Button ist dann deaktiviert, dennoch ist das minimieren normal möglich.

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:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TForm1 = class(TForm)
  private
    procedure CreateParams(var Params: TCreateParams); override;
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

{ TForm1 }

procedure TForm1.CreateParams(var Params: TCreateParams);
begin
  inherited;
  Params.Style := Params.Style And Not WS_MAXIMIZEBOX ;
end;

end.


Das Problem ist eben das ich bssingle benutzen möchte und da funktioniert das Minimieren immer noch nicht richtig...
Stefan S.
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 184


D5
BeitragVerfasst: Di 01.05.07 14:05 
Ich glaube nicht, dass dieses "falsche" Minimieren etwas mit dem BorderStyle oder den BorderIcons zu tun hat, sondern nur damit, dass alle Formulare dem Hauptformular, standardmäßig Form1, untergeordnet sind (das ja auch nie geschlossen, sondern nur mit Hide versteckt wird). Das selbe Problem hatte ich nämlich auch schon (Thread) und es tritt genau so auf, wenn BorderStyle "Sizeable" oder "Dialog" ist.