Danke auch für deine Antwort!
Ich habe so eben eine neue Anwendung erstellt.
Code "Form1" (=Main-Form):
Delphi-Quellcode:
unit mTest;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, mTest2;
type
TForm1 =
class(TForm)
btForm2: TButton;
btMSG: TButton;
procedure btMSGClick(Sender: TObject);
procedure btForm2Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.btMSGClick(Sender: TObject);
begin
ShowMessage('
Blub');
end;
procedure TForm1.btForm2Click(Sender: TObject);
var
NewForm: TForm2;
begin
NewForm := TForm2.Create(self);
NewForm.ShowModal;
NewForm.Free;
end;
end.
Code "Form2" (=weireres Fenster):
Delphi-Quellcode:
unit mTest2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm2 =
class(TForm)
btClose: TButton;
procedure btCloseClick(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.btCloseClick(Sender: TObject);
begin
Close;
end;
end.
Wenn ich "FormStyle" auf "fsnormal" lasse, klappt es auch, wie es soll