unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;
type
TForm1 =
class(TForm)
PageControlSQL: TPageControl;
Button1: TButton;
Button2: TButton;
OpenDialog1: TOpenDialog;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
anzSQL:Integer = 0;
Sheet :
array of TTabSheet;
SQLMemo :
array of TMemo;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
SetLength(Sheet, anzSQL + 1);
SetLength(SQLMemo, anzSQL + 1);
// TabSheet erstellen
Sheet[anzSQL] := TTabSheet.Create(PageControlSQL);
Sheet[anzSQL].Parent := PageControlSQL;
Sheet[anzSQL].PageControl := PageControlSQL;
Sheet[anzSQL].Caption := '
(Unbenannt)';
// SQLMemo erstellen
SQLMemo[anzSQL] := TMemo.Create(Sheet[anzSQL]);
SQLMemo[anzSQL].Parent := Sheet[anzSQL];
SQLMemo[anzSQL].Align := alClient;
// PageControl auf erstellen TabSheet stellen
Inc(anzSQL);
PageControlSQL.ActivePageIndex := PageControlSQL.PageCount - 1;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if OpenDialog1.Execute
then
begin
SQLMemo[PageControlSQL.ActivePageIndex].Lines.LoadFromFile(OpenDialog1.FileName);
end;
end;
end.