Einzelnen Beitrag anzeigen

Benutzerbild von Taladan
Taladan

Registriert seit: 5. Aug 2003
Ort: Osnabrück
505 Beiträge
 
Delphi 2005 Professional
 
#20

Re: Auf anderes Fenster zugreifen

  Alt 2. Jul 2005, 15:16
Ok hier ist er

UDaten:
Delphi-Quellcode:
unit UDaten;

interface

uses
  System.Drawing, System.Collections, System.ComponentModel,
  System.Windows.Forms, System.Data, Borland.Vcl.SysUtils,
  borland.Vcl.Classes, System.Globalization,
  System.Data.SqlClient, Borland.Vcl.Dialogs;

type
  DatenBox = class(System.Windows.Forms.Form)
  {$REGION 'Vom Designer verwalteter Code'}
  strict private
    /// <summary>
    /// Erforderliche Designervariable.
    /// </summary>
    Components: System.ComponentModel.Container;
    bar: System.Windows.Forms.Panel;
    StatusBar1: System.Windows.Forms.StatusBar;
    ToolBar1: System.Windows.Forms.ToolBar;
    Button1: System.Windows.Forms.Button;
    Button2: System.Windows.Forms.Button;
    Button3: System.Windows.Forms.Button;
    Panel1: System.Windows.Forms.Panel;
    Panel2: System.Windows.Forms.Panel;
    Panel3: System.Windows.Forms.Panel;
    ListBox1: System.Windows.Forms.ListBox;
    TextBox1: System.Windows.Forms.TextBox;
    TextBox2: System.Windows.Forms.TextBox;
    TextBox3: System.Windows.Forms.TextBox;
    TextBox5: System.Windows.Forms.TextBox;
    TextBox4: System.Windows.Forms.TextBox;
    Button4: System.Windows.Forms.Button;
    Panel4: System.Windows.Forms.Panel;
    Button5: System.Windows.Forms.Button;
    Panel5: System.Windows.Forms.Panel;
    Button6: System.Windows.Forms.Button;
    Panel6: System.Windows.Forms.Panel;
    Button7: System.Windows.Forms.Button;
    /// <summary>
    /// Erforderliche Methode zur Unterstützung des Designers -
    /// ändern Sie die Methode nicht mit dem Quelltext-Editor
    /// </summary>
    procedure InitializeComponent;
    procedure Button1_Click(sender: System.Object; e: System.EventArgs);
    procedure DatenBox_Load(sender: System.Object; e: System.EventArgs);
    procedure Button2_Click(sender: System.Object; e: System.EventArgs);
    procedure Button3_Click(sender: System.Object; e: System.EventArgs);
    procedure Button4_Click(sender: System.Object; e: System.EventArgs);
    procedure Button5_Click(sender: System.Object; e: System.EventArgs);
    procedure Button6_Click(sender: System.Object; e: System.EventArgs);
    procedure DatenBox_Load1(sender: System.Object; e: System.EventArgs);
    procedure Button7_Click(sender: System.Object; e: System.EventArgs);
  {$ENDREGION}
  strict protected
    /// <summary>
    /// Ressourcen nach der Verwendung bereinigen
    /// </summary>
    procedure Dispose(Disposing: Boolean); override;
  private
    { Private-Deklarationen }
    procedure ClickBar(Nr : Integer);
    function get_MainForm : Form;
    property Mainform : Form read get_MainForm;
  public
    constructor Create;
  end;

  [assembly: RuntimeRequiredAttribute(TypeOf(DatenBox))]

implementation

uses uhauptfenster;


{$AUTOBOX ON}

{$REGION 'Vom Windows Form-Designer erzeugter Code'}
/// <summary>
/// Erforderliche Methode zur Unterstützung des Designers --
/// ändern Sie die Methode nicht mit dem Quelltext-Editor
/// </summary>
procedure DatenBox.InitializeComponent;
begin
  Self.StatusBar1 := System.Windows.Forms.StatusBar.Create;
  Self.ToolBar1 := System.Windows.Forms.ToolBar.Create;
  Self.bar := System.Windows.Forms.Panel.Create;
  Self.Panel6 := System.Windows.Forms.Panel.Create;
  Self.Button6 := System.Windows.Forms.Button.Create;
  Self.Panel5 := System.Windows.Forms.Panel.Create;
  Self.Button5 := System.Windows.Forms.Button.Create;
  Self.Panel4 := System.Windows.Forms.Panel.Create;
  Self.Button4 := System.Windows.Forms.Button.Create;
  Self.Panel3 := System.Windows.Forms.Panel.Create;
  Self.Button3 := System.Windows.Forms.Button.Create;
  Self.Panel2 := System.Windows.Forms.Panel.Create;
  Self.Button2 := System.Windows.Forms.Button.Create;
  Self.Panel1 := System.Windows.Forms.Panel.Create;
  Self.Button1 := System.Windows.Forms.Button.Create;
  Self.ListBox1 := System.Windows.Forms.ListBox.Create;
  Self.TextBox1 := System.Windows.Forms.TextBox.Create;
  Self.TextBox2 := System.Windows.Forms.TextBox.Create;
  Self.TextBox3 := System.Windows.Forms.TextBox.Create;
  Self.TextBox5 := System.Windows.Forms.TextBox.Create;
  Self.TextBox4 := System.Windows.Forms.TextBox.Create;
  Self.Button7 := System.Windows.Forms.Button.Create;
  Self.bar.SuspendLayout;
  Self.SuspendLayout;
  //
  // StatusBar1
  //
  Self.StatusBar1.Location := System.Drawing.Point.Create(0, 384);
  Self.StatusBar1.Name := 'StatusBar1';
  Self.StatusBar1.Size := System.Drawing.Size.Create(592, 22);
  Self.StatusBar1.TabIndex := 0;
  Self.StatusBar1.Text := 'StatusBar1';
  //
  // ToolBar1
  //
  Self.ToolBar1.Dock := System.Windows.Forms.DockStyle.None;
  Self.ToolBar1.DropDownArrows := True;
  Self.ToolBar1.Location := System.Drawing.Point.Create(136, 336);
  Self.ToolBar1.Name := 'ToolBar1';
  Self.ToolBar1.ShowToolTips := True;
  Self.ToolBar1.Size := System.Drawing.Size.Create(456, 42);
  Self.ToolBar1.TabIndex := 2;
  //
  // bar
  //
  Self.bar.Controls.Add(Self.Panel6);
  Self.bar.Controls.Add(Self.Button6);
  Self.bar.Controls.Add(Self.Panel5);
  Self.bar.Controls.Add(Self.Button5);
  Self.bar.Controls.Add(Self.Panel4);
  Self.bar.Controls.Add(Self.Button4);
  Self.bar.Controls.Add(Self.Panel3);
  Self.bar.Controls.Add(Self.Button3);
  Self.bar.Controls.Add(Self.Panel2);
  Self.bar.Controls.Add(Self.Button2);
  Self.bar.Controls.Add(Self.Panel1);
  Self.bar.Controls.Add(Self.Button1);
  Self.bar.Dock := System.Windows.Forms.DockStyle.Left;
  Self.bar.Location := System.Drawing.Point.Create(0, 0);
  Self.bar.Name := 'bar';
  Self.bar.Size := System.Drawing.Size.Create(136, 384);
  Self.bar.TabIndex := 3;
  //
  // Panel6
  //
  Self.Panel6.Dock := System.Windows.Forms.DockStyle.Top;
  Self.Panel6.Location := System.Drawing.Point.Create(0, 189);
  Self.Panel6.Name := 'Panel6';
  Self.Panel6.Size := System.Drawing.Size.Create(136, 11);
  Self.Panel6.TabIndex := 12;
  //
  // Button6
  //
  Self.Button6.Dock := System.Windows.Forms.DockStyle.Top;
  Self.Button6.Location := System.Drawing.Point.Create(0, 166);
  Self.Button6.Name := 'Button6';
  Self.Button6.Size := System.Drawing.Size.Create(136, 23);
  Self.Button6.TabIndex := 11;
  Self.Button6.Text := 'Button6';
  Include(Self.Button6.Click, Self.Button6_Click);
  //
  // Panel5
  //
  Self.Panel5.Dock := System.Windows.Forms.DockStyle.Top;
  Self.Panel5.Location := System.Drawing.Point.Create(0, 158);
  Self.Panel5.Name := 'Panel5';
  Self.Panel5.Size := System.Drawing.Size.Create(136, 8);
  Self.Panel5.TabIndex := 10;
  //
  // Button5
  //
  Self.Button5.Dock := System.Windows.Forms.DockStyle.Top;
  Self.Button5.Location := System.Drawing.Point.Create(0, 135);
  Self.Button5.Name := 'Button5';
  Self.Button5.Size := System.Drawing.Size.Create(136, 23);
  Self.Button5.TabIndex := 9;
  Self.Button5.Text := 'Button5';
  Include(Self.Button5.Click, Self.Button5_Click);
  //
  // Panel4
  //
  Self.Panel4.Dock := System.Windows.Forms.DockStyle.Top;
  Self.Panel4.Location := System.Drawing.Point.Create(0, 127);
  Self.Panel4.Name := 'Panel4';
  Self.Panel4.Size := System.Drawing.Size.Create(136, 8);
  Self.Panel4.TabIndex := 8;
  //
  // Button4
  //
  Self.Button4.Dock := System.Windows.Forms.DockStyle.Top;
  Self.Button4.Location := System.Drawing.Point.Create(0, 104);
  Self.Button4.Name := 'Button4';
  Self.Button4.Size := System.Drawing.Size.Create(136, 23);
  Self.Button4.TabIndex := 7;
  Self.Button4.Text := 'Button4';
  Include(Self.Button4.Click, Self.Button4_Click);
  //
  // Panel3
  //
  Self.Panel3.Dock := System.Windows.Forms.DockStyle.Top;
  Self.Panel3.Location := System.Drawing.Point.Create(0, 95);
  Self.Panel3.Name := 'Panel3';
  Self.Panel3.Size := System.Drawing.Size.Create(136, 9);
  Self.Panel3.TabIndex := 6;
  //
  // Button3
  //
  Self.Button3.Dock := System.Windows.Forms.DockStyle.Top;
  Self.Button3.Location := System.Drawing.Point.Create(0, 72);
  Self.Button3.Name := 'Button3';
  Self.Button3.Size := System.Drawing.Size.Create(136, 23);
  Self.Button3.TabIndex := 5;
  Self.Button3.Text := 'Button3';
  Include(Self.Button3.Click, Self.Button3_Click);
  //
  // Panel2
  //
  Self.Panel2.BackColor := System.Drawing.SystemColors.ControlDarkDark;
  Self.Panel2.Dock := System.Windows.Forms.DockStyle.Top;
  Self.Panel2.Location := System.Drawing.Point.Create(0, 55);
  Self.Panel2.Name := 'Panel2';
  Self.Panel2.Size := System.Drawing.Size.Create(136, 17);
  Self.Panel2.TabIndex := 4;
  //
  // Button2
  //
  Self.Button2.Dock := System.Windows.Forms.DockStyle.Top;
  Self.Button2.Location := System.Drawing.Point.Create(0, 32);
  Self.Button2.Name := 'Button2';
  Self.Button2.Size := System.Drawing.Size.Create(136, 23);
  Self.Button2.TabIndex := 3;
  Self.Button2.Text := 'Button2';
  Include(Self.Button2.Click, Self.Button2_Click);
  //
  // Panel1
  //
  Self.Panel1.BackColor := System.Drawing.SystemColors.ActiveCaption;
  Self.Panel1.Dock := System.Windows.Forms.DockStyle.Top;
  Self.Panel1.ForeColor := System.Drawing.SystemColors.ActiveCaption;
  Self.Panel1.Location := System.Drawing.Point.Create(0, 23);
  Self.Panel1.Name := 'Panel1';
  Self.Panel1.Size := System.Drawing.Size.Create(136, 9);
  Self.Panel1.TabIndex := 2;
  //
  // Button1
  //
  Self.Button1.Dock := System.Windows.Forms.DockStyle.Top;
  Self.Button1.Location := System.Drawing.Point.Create(0, 0);
  Self.Button1.Name := 'Button1';
  Self.Button1.Size := System.Drawing.Size.Create(136, 23);
  Self.Button1.TabIndex := 0;
  Self.Button1.Text := 'Button1';
  Include(Self.Button1.Click, Self.Button1_Click);
  //
  // ListBox1
  //
  Self.ListBox1.BackColor := System.Drawing.Color.Cornsilk;
  Self.ListBox1.Location := System.Drawing.Point.Create(456, 8);
  Self.ListBox1.Name := 'ListBox1';
  Self.ListBox1.Size := System.Drawing.Size.Create(128, 316);
  Self.ListBox1.TabIndex := 4;
  //
  // TextBox1
  //
  Self.TextBox1.BorderStyle := System.Windows.Forms.BorderStyle.FixedSingle;
  Self.TextBox1.Location := System.Drawing.Point.Create(280, 24);
  Self.TextBox1.Name := 'TextBox1';
  Self.TextBox1.TabIndex := 5;
  Self.TextBox1.Text := 'TextBox1';
  //
  // TextBox2
  //
  Self.TextBox2.BorderStyle := System.Windows.Forms.BorderStyle.FixedSingle;
  Self.TextBox2.Cursor := System.Windows.Forms.Cursors.IBeam;
  Self.TextBox2.Location := System.Drawing.Point.Create(280, 56);
  Self.TextBox2.Name := 'TextBox2';
  Self.TextBox2.TabIndex := 6;
  Self.TextBox2.Text := 'TextBox2';
  //
  // TextBox3
  //
  Self.TextBox3.BorderStyle := System.Windows.Forms.BorderStyle.FixedSingle;
  Self.TextBox3.Cursor := System.Windows.Forms.Cursors.IBeam;
  Self.TextBox3.Location := System.Drawing.Point.Create(280, 88);
  Self.TextBox3.Name := 'TextBox3';
  Self.TextBox3.TabIndex := 7;
  Self.TextBox3.Text := 'TextBox3';
  //
  // TextBox5
  //
  Self.TextBox5.BorderStyle := System.Windows.Forms.BorderStyle.FixedSingle;
  Self.TextBox5.Cursor := System.Windows.Forms.Cursors.IBeam;
  Self.TextBox5.Location := System.Drawing.Point.Create(280, 152);
  Self.TextBox5.Name := 'TextBox5';
  Self.TextBox5.TabIndex := 9;
  Self.TextBox5.Text := 'TextBox5';
  //
  // TextBox4
  //
  Self.TextBox4.BorderStyle := System.Windows.Forms.BorderStyle.FixedSingle;
  Self.TextBox4.Cursor := System.Windows.Forms.Cursors.IBeam;
  Self.TextBox4.Location := System.Drawing.Point.Create(280, 120);
  Self.TextBox4.Name := 'TextBox4';
  Self.TextBox4.TabIndex := 10;
  Self.TextBox4.Text := 'TextBox4';
  //
  // Button7
  //
  Self.Button7.Location := System.Drawing.Point.Create(216, 232);
  Self.Button7.Name := 'Button7';
  Self.Button7.TabIndex := 11;
  Self.Button7.Text := 'Button7';
  Include(Self.Button7.Click, Self.Button7_Click);
  //
  // DatenBox
  //
  Self.AutoScaleBaseSize := System.Drawing.Size.Create(5, 13);
  Self.ClientSize := System.Drawing.Size.Create(592, 406);
  Self.Controls.Add(Self.Button7);
  Self.Controls.Add(Self.TextBox4);
  Self.Controls.Add(Self.TextBox5);
  Self.Controls.Add(Self.TextBox3);
  Self.Controls.Add(Self.TextBox2);
  Self.Controls.Add(Self.TextBox1);
  Self.Controls.Add(Self.ListBox1);
  Self.Controls.Add(Self.bar);
  Self.Controls.Add(Self.ToolBar1);
  Self.Controls.Add(Self.StatusBar1);
  Self.FormBorderStyle := System.Windows.Forms.FormBorderStyle.FixedToolWindow;
  Self.Name := 'DatenBox';
  Self.StartPosition := System.Windows.Forms.FormStartPosition.CenterScreen;
  Self.Text := 'Daten editieren';
  Self.TopMost := True;
  Include(Self.Load, Self.DatenBox_Load1);
  Self.bar.ResumeLayout(False);
  Self.ResumeLayout(False);
end;
{$ENDREGION}

function DatenBox.get_MainForm : Form;
begin
   result := MDIParent as Hauptfenster;
end;

procedure DatenBox.Dispose(Disposing: Boolean);
begin
  if Disposing then
  begin
    if Components <> nil then
      Components.Dispose();
  end;
  inherited Dispose(Disposing);
end;

constructor DatenBox.Create;
begin
  inherited Create;
  //
  // Erforderlich für die Unterstützung des Windows Forms-Designers
  //
  InitializeComponent;
  //
  // TODO: Fügen Sie nach dem Aufruf von InitializeComponent Konstruktorcode hinzu.
  //
end;

procedure DatenBox.Button7_Click(sender: System.Object; e: System.EventArgs);
begin
// (Mainform as Hauptfenster)
  Mainform.Labeltext := 'Test';
end;

procedure DatenBox.DatenBox_Load1(sender: System.Object; e: System.EventArgs);
begin
// Mainform.LabelText
end;

procedure DatenBox.Button6_Click(sender: System.Object; e: System.EventArgs);
begin
  Clickbar(6);
end;

procedure DatenBox.Button5_Click(sender: System.Object; e: System.EventArgs);
begin
  Clickbar(5);
end;

procedure DatenBox.Button4_Click(sender: System.Object; e: System.EventArgs);
begin
  clickbar(4);
end;

procedure DatenBox.Button3_Click(sender: System.Object; e: System.EventArgs);
begin
  ClickBar(3);
end;

procedure DatenBox.Button2_Click(sender: System.Object; e: System.EventArgs);
begin
  Clickbar(2);
end;

procedure DatenBox.DatenBox_Load(sender: System.Object; e: System.EventArgs);
begin

end;

procedure DatenBox.Button1_Click(sender: System.Object; e: System.EventArgs);
begin
  Clickbar(1);
end;

procedure DatenBox.ClickBar(Nr : Integer);
//var i : integer;
begin
// hauptfenster.label1.text;
//for i := 0 to 5 do begin
// button[i].visible := false;
// panel[i].visible := false:
// end;
  Button1.Dock := DockStyle.None;
  Button2.Dock := DockStyle.None;
  Button3.Dock := DockStyle.None;
  Button4.Dock := DockStyle.None;
  Button5.Dock := DockStyle.None;
  Button6.Dock := DockStyle.None;
  Panel1.Visible := false;
  Panel2.Visible := false;
  Panel3.Visible := false;
  Panel4.Visible := false;
  Panel5.Visible := false;
  Panel6.Visible := false;
  case nr of
    1: Begin
          Button1.Dock := DockStyle.Top;
          Button6.Dock := Dockstyle.Bottom;
          Button5.Dock := Dockstyle.Bottom;
          Button4.Dock := Dockstyle.Bottom;
          Button3.Dock := Dockstyle.Bottom;
          Button2.Dock := Dockstyle.Bottom;
          Panel1.Visible := true;
          Panel1.Dock := Dockstyle.Fill;
        end;
    2: Begin
          Button1.Dock := DockStyle.Top;
          Button2.Dock := Dockstyle.Top;
          Button6.Dock := Dockstyle.Bottom;
          Button5.Dock := Dockstyle.Bottom;
          Button4.Dock := Dockstyle.Bottom;
          Button3.Dock := Dockstyle.Bottom;
          Panel2.Visible := true;
          Panel2.Dock := Dockstyle.Fill;
        end;
    3: Begin
          Button1.Dock := DockStyle.Top;
          Button2.Dock := Dockstyle.Top;
          Button3.Dock := Dockstyle.Top;
          Button6.Dock := Dockstyle.Bottom;
          Button5.Dock := Dockstyle.Bottom;
          Button4.Dock := Dockstyle.Bottom;
          Panel3.Visible := True;
          Panel3.Dock := Dockstyle.Fill;
        end;
    4: Begin
          Button1.Dock := DockStyle.Top;
          Button2.Dock := Dockstyle.Top;
          Button3.Dock := Dockstyle.Top;
          Button4.Dock := Dockstyle.Top;
          Button6.Dock := Dockstyle.Bottom;
          Button5.Dock := Dockstyle.Bottom;
          Panel4.Visible := true;
          Panel4.Dock := Dockstyle.Fill;
        End;
    5: Begin
          Button1.Dock := DockStyle.Top;
          Button2.Dock := Dockstyle.Top;
          Button3.Dock := Dockstyle.Top;
          Button4.Dock := Dockstyle.Top;
          Button5.Dock := Dockstyle.Top;
          Button6.Dock := Dockstyle.Bottom;
          Panel5.Visible := True;
          Panel5.Dock := Dockstyle.Fill;
        End;
    6: Begin
          Button1.Dock := DockStyle.Top;
          Button2.Dock := Dockstyle.Top;
          Button3.Dock := Dockstyle.Top;
          Button4.Dock := Dockstyle.Top;
          Button5.Dock := Dockstyle.Top;
          Button6.Dock := Dockstyle.Top;
          Panel6.Visible := True;
          Panel6.Dock := Dockstyle.Fill;
        end;
  end;
end;

end.
UHauptform

Delphi-Quellcode:
unit UHauptfenster;

interface

uses
  System.Drawing, System.Collections, System.ComponentModel,
  System.Windows.Forms, System.Data, System.Globalization,
  Borland.Vcl.Forms, System.Data.SqlClient;

type
  Hauptfenster = class(System.Windows.Forms.Form)
  {$REGION 'Vom Designer verwalteter Code'}
  strict private
    /// <summary>
    /// Erforderliche Designervariable.
    /// </summary>
    Components: System.ComponentModel.Container;
    Rasse: System.Data.DataTable;
    DataColumn1: System.Data.DataColumn;
    DataColumn2: System.Data.DataColumn;
    DataColumn3: System.Data.DataColumn;
    DataColumn4: System.Data.DataColumn;
    MainMenu1: System.Windows.Forms.MainMenu;
    MenuItem1: System.Windows.Forms.MenuItem;
    MenuItem2: System.Windows.Forms.MenuItem;
    MenuItem3: System.Windows.Forms.MenuItem;
    MenuItem4: System.Windows.Forms.MenuItem;
    MenuItem5: System.Windows.Forms.MenuItem;
    MenuItem6: System.Windows.Forms.MenuItem;
    MenuItem7: System.Windows.Forms.MenuItem;
    MenuItem8: System.Windows.Forms.MenuItem;
    MenuItem9: System.Windows.Forms.MenuItem;
    MenuItem10: System.Windows.Forms.MenuItem;
    MenuItem11: System.Windows.Forms.MenuItem;
    Label1: System.Windows.Forms.Label;
    /// <summary>
    /// Erforderliche Methode zur Unterstützung des Designers -
    /// ändern Sie die Methode nicht mit dem Quelltext-Editor
    /// </summary>
    procedure InitializeComponent;
    procedure MenuItem2_Click(sender: System.Object; e: System.EventArgs);
    procedure MenuItem3_Click(sender: System.Object; e: System.EventArgs);
    procedure MenuItem5_Click(sender: System.Object; e: System.EventArgs);
    procedure MenuItem6_Click(sender: System.Object; e: System.EventArgs);
    procedure MenuItem7_Click(sender: System.Object; e: System.EventArgs);
    procedure MenuItem9_Click(sender: System.Object; e: System.EventArgs);
    procedure MenuItem11_Click(sender: System.Object; e: System.EventArgs);
    procedure Button1_Click(sender: System.Object; e: System.EventArgs);
    procedure Hauptfenster_Load(sender: System.Object; e: System.EventArgs);
  {$ENDREGION}
  strict protected
    /// <summary>
    /// Ressourcen nach der Verwendung bereinigen
    /// </summary>
    procedure Dispose(Disposing: Boolean); override;
  private
    { Private-Deklarationen }
    function getLabel : string;
    procedure SetLabel(lab : string);
  public
    DataSet1: System.Data.DataSet;
    property Labeltext : string read getLabel write SetLabel;
    constructor Create;
  end;

  [assembly: RuntimeRequiredAttribute(TypeOf(Hauptfenster))]

implementation

uses UDaten;

{$AUTOBOX ON}

{$REGION 'Vom Windows Form-Designer erzeugter Code'}
/// <summary>
/// Erforderliche Methode zur Unterstützung des Designers --
/// ändern Sie die Methode nicht mit dem Quelltext-Editor
/// </summary>
procedure Hauptfenster.InitializeComponent;
type
  TArrayOfSystem_Data_DataTable = array of System.Data.DataTable;
  TArrayOfSystem_Data_DataColumn = array of System.Data.DataColumn;
  TArrayOfSystem_Data_Constraint = array of System.Data.Constraint;
  TArrayOfString = array of string;
  TArrayOfSystem_Windows_Forms_MenuItem = array of System.Windows.Forms.MenuItem;
begin
  Self.DataSet1 := System.Data.DataSet.Create;
  Self.Rasse := System.Data.DataTable.Create;
  Self.DataColumn1 := System.Data.DataColumn.Create;
  Self.DataColumn2 := System.Data.DataColumn.Create;
  Self.DataColumn3 := System.Data.DataColumn.Create;
  Self.DataColumn4 := System.Data.DataColumn.Create;
  Self.MainMenu1 := System.Windows.Forms.MainMenu.Create;
  Self.MenuItem1 := System.Windows.Forms.MenuItem.Create;
  Self.MenuItem10 := System.Windows.Forms.MenuItem.Create;
  Self.MenuItem11 := System.Windows.Forms.MenuItem.Create;
  Self.MenuItem2 := System.Windows.Forms.MenuItem.Create;
  Self.MenuItem3 := System.Windows.Forms.MenuItem.Create;
  Self.MenuItem4 := System.Windows.Forms.MenuItem.Create;
  Self.MenuItem5 := System.Windows.Forms.MenuItem.Create;
  Self.MenuItem6 := System.Windows.Forms.MenuItem.Create;
  Self.MenuItem7 := System.Windows.Forms.MenuItem.Create;
  Self.MenuItem8 := System.Windows.Forms.MenuItem.Create;
  Self.MenuItem9 := System.Windows.Forms.MenuItem.Create;
  Self.Label1 := System.Windows.Forms.Label.Create;
  (System.ComponentModel.ISupportInitialize(Self.DataSet1)).BeginInit;
  (System.ComponentModel.ISupportInitialize(Self.Rasse)).BeginInit;
  Self.SuspendLayout;
  //
  // DataSet1
  //
  Self.DataSet1.DataSetName := 'NewDataSet';
  Self.DataSet1.Locale := System.Globalization.CultureInfo.Create('de-DE');
  Self.DataSet1.Tables.AddRange(TArrayOfSystem_Data_DataTable.Create(Self.Rasse));
  //
  // Rasse
  //
  Self.Rasse.Columns.AddRange(TArrayOfSystem_Data_DataColumn.Create(Self.DataColumn1,
          Self.DataColumn2, Self.DataColumn3, Self.DataColumn4));
  Self.Rasse.Constraints.AddRange(TArrayOfSystem_Data_Constraint.Create(System.Data.UniqueConstraint.Create('C' +
          'onstraint1', TArrayOfString.Create('Id'), False)));
  Self.Rasse.TableName := 'Rasse';
  //
  // DataColumn1
  //
  Self.DataColumn1.AutoIncrement := True;
  Self.DataColumn1.ColumnName := 'Id';
  Self.DataColumn1.DataType := TypeOf(Integer);
  //
  // DataColumn2
  //
  Self.DataColumn2.ColumnName := 'Name';
  //
  // DataColumn3
  //
  Self.DataColumn3.ColumnName := 'Buch';
  Self.DataColumn3.DataType := TypeOf(Integer);
  //
  // DataColumn4
  //
  Self.DataColumn4.ColumnName := 'Seite';
  Self.DataColumn4.DataType := TypeOf(Integer);
  //
  // MainMenu1
  //
  Self.MainMenu1.MenuItems.AddRange(TArrayOfSystem_Windows_Forms_MenuItem.Create(Self.MenuItem1,
          Self.MenuItem2, Self.MenuItem4));
  //
  // MenuItem1
  //
  Self.MenuItem1.Index := 0;
  Self.MenuItem1.MenuItems.AddRange(TArrayOfSystem_Windows_Forms_MenuItem.Create(Self.MenuItem10,
          Self.MenuItem11));
  Self.MenuItem1.Text := '&Datei';
  //
  // MenuItem10
  //
  Self.MenuItem10.Index := 0;
  Self.MenuItem10.Text := '--';
  //
  // MenuItem11
  //
  Self.MenuItem11.Index := 1;
  Self.MenuItem11.Text := '&Beenden';
  Include(Self.MenuItem11.Click, Self.MenuItem11_Click);
  //
  // MenuItem2
  //
  Self.MenuItem2.Index := 1;
  Self.MenuItem2.MenuItems.AddRange(TArrayOfSystem_Windows_Forms_MenuItem.Create(Self.MenuItem3));
  Self.MenuItem2.Text := '&Optionen';
  Include(Self.MenuItem2.Click, Self.MenuItem2_Click);
  //
  // MenuItem3
  //
  Self.MenuItem3.Index := 0;
  Self.MenuItem3.Text := '&Daten';
  Include(Self.MenuItem3.Click, Self.MenuItem3_Click);
  //
  // MenuItem4
  //
  Self.MenuItem4.Index := 2;
  Self.MenuItem4.MenuItems.AddRange(TArrayOfSystem_Windows_Forms_MenuItem.Create(Self.MenuItem5,
          Self.MenuItem6, Self.MenuItem7, Self.MenuItem8, Self.MenuItem9));
  Self.MenuItem4.Text := '&Fenster';
  //
  // MenuItem5
  //
  Self.MenuItem5.Index := 0;
  Self.MenuItem5.Text := '&Horizontal aufteilen';
  Include(Self.MenuItem5.Click, Self.MenuItem5_Click);
  //
  // MenuItem6
  //
  Self.MenuItem6.Index := 1;
  Self.MenuItem6.Text := '&Vertikal aufteilen';
  Include(Self.MenuItem6.Click, Self.MenuItem6_Click);
  //
  // MenuItem7
  //
  Self.MenuItem7.Index := 2;
  Self.MenuItem7.Text := '&Kaskadieren';
  Include(Self.MenuItem7.Click, Self.MenuItem7_Click);
  //
  // MenuItem8
  //
  Self.MenuItem8.Index := 3;
  Self.MenuItem8.Text := '-';
  //
  // MenuItem9
  //
  Self.MenuItem9.Index := 4;
  Self.MenuItem9.Text := '&Test';
  Include(Self.MenuItem9.Click, Self.MenuItem9_Click);
  //
  // Label1
  //
  Self.Label1.Location := System.Drawing.Point.Create(184, 112);
  Self.Label1.Name := 'Label1';
  Self.Label1.TabIndex := 1;
  Self.Label1.Text := 'Label1';
  //
  // Hauptfenster
  //
  Self.AutoScaleBaseSize := System.Drawing.Size.Create(5, 13);
  Self.ClientSize := System.Drawing.Size.Create(496, 362);
  Self.Controls.Add(Self.Label1);
  Self.IsMdiContainer := True;
  Self.Menu := Self.MainMenu1;
  Self.Name := 'Hauptfenster';
  Self.Text := 'Taladans - DSA -Tools';
  Self.WindowState := System.Windows.Forms.FormWindowState.Maximized;
  Include(Self.Load, Self.Hauptfenster_Load);
  (System.ComponentModel.ISupportInitialize(Self.DataSet1)).EndInit;
  (System.ComponentModel.ISupportInitialize(Self.Rasse)).EndInit;
  Self.ResumeLayout(False);
end;
{$ENDREGION}

function Hauptfenster.getLabel : String;
begin
  result := Label1.Text;
end;

procedure Hauptfenster.SetLabel(lab : String);
begin
  Label1.Text := lab;
end;


procedure Hauptfenster.Dispose(Disposing: Boolean);
begin
  if Disposing then
  begin
    if Components <> nil then
      Components.Dispose();
  end;
  inherited Dispose(Disposing);
end;

constructor Hauptfenster.Create;
begin
  inherited Create;
  //
  // Erforderlich für die Unterstützung des Windows Forms-Designers
  //
  InitializeComponent;
  //
  // TODO: Fügen Sie nach dem Aufruf von InitializeComponent Konstruktorcode hinzu.
  //
end;

procedure Hauptfenster.Hauptfenster_Load(sender: System.Object; e: System.EventArgs);
begin
  with DatenBox.Create do
  try
    MDIParent := self;
    Show;
  finally
    Dispose();
  end;
  with DatenBox.Create do begin
    MdiParent := self;
    Show;
  end;
end;

procedure Hauptfenster.Button1_Click(sender: System.Object; e: System.EventArgs);
begin
  DataSet1.WriteXML('test.xml');
end;

procedure Hauptfenster.MenuItem11_Click(sender: System.Object; e: System.EventArgs);
begin
  close;
end;

procedure Hauptfenster.MenuItem9_Click(sender: System.Object; e: System.EventArgs);
begin
    LayoutMDI(MDILayout.ArrangeIcons);
end;

procedure Hauptfenster.MenuItem7_Click(sender: System.Object; e: System.EventArgs);
begin
    LayoutMDI(MDILayout.Cascade);
end;

procedure Hauptfenster.MenuItem6_Click(sender: System.Object; e: System.EventArgs);
begin
    LayoutMDI(MDILayout.TileVertical);
end;

procedure Hauptfenster.MenuItem5_Click(sender: System.Object; e: System.EventArgs);
begin
    LayoutMDI(MDILayout.TileHorizontal);
end;

procedure Hauptfenster.MenuItem3_Click(sender: System.Object; e: System.EventArgs);
begin
  with DatenBox.Create do begin
    MdiParent := self;
    Show;
  end;
end;

procedure Hauptfenster.MenuItem2_Click(sender: System.Object; e: System.EventArgs);
begin

end;

end.
Marco
Wer Rechtschreibfehler findet, der darf sie behalten

Carpe Diem - Nutze den Tag (und zwar den ganzen!)
  Mit Zitat antworten Zitat