// Code wo der Fehler auftritt
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons;
type
TfMain =
class(TForm)
BitBtn1: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
fMain: TfMain;
implementation
uses Unit2;
{$R *.DFM}
procedure TfMain.BitBtn1Click(Sender: TObject);
begin
fMDI.Show();
end;
end.
//-----------------------------------------------------------------------------
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Menus, ImgList, ComCtrls, ToolWin,ChildWin;
type
TfMDI =
class(TForm)
MainMenu1: TMainMenu;
Einstellungen1: TMenuItem;
ToolBar1: TToolBar;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
ImageList1: TImageList;
ToolButton3: TToolButton;
procedure FormCreate(Sender: TObject);
procedure ToolButton3Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
procedure CreateMDIChild(
const Name:
string);
end;
var
fMDI: TfMDI;
implementation
uses Unit1;
{$R *.DFM}
procedure TfMDI.CreateMDIChild(
const Name:
string);
var
Child: TMDIChild;
begin
//new MDI child window
Child := TMDIChild.Create(Application);
Child.Caption :=
Name;
end;
procedure TfMDI.FormCreate(Sender: TObject);
begin
CreateMDIChild('
NewWindwow' + IntToStr(MDIChildCount + 1));
end;
end.
//-------------------------------------------------------------------------------