Einzelnen Beitrag anzeigen

Finki

Registriert seit: 2. Jul 2013
120 Beiträge
 
FreePascal / Lazarus
 
#20

AW: Während Programm läuft

  Alt 10. Aug 2013, 12:41
immer noch der gleiche Fehler

newformframe.pas(94,40) Error: Wrong number of parameters specified for call to "MeinEigenesOnClick"

Delphi-Quellcode:
type

  { TForm3 }

  TForm3 = class(TForm)
    Button1: TButton;
    Memo1: TMemo;
    procedure Button1Click(Sender: TObject);
    procedure FormChangeBounds(Sender: TObject);
    procedure FormClick(Sender: TObject);
    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    procedure FormCreate(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure MeinEigenesOnClick(Sender: TObject);

  private
    { private declarations }
  public

  end;
und Hier mal der Quellcod der ganzen Unit

Delphi-Quellcode:
unit NewFormFrame;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  ComCtrls, Buttons, ExtCtrls;

type

  { TForm3 }

  TForm3 = class(TForm)
    Button1: TButton;
    Memo1: TMemo;
    procedure Button1Click(Sender: TObject);
    procedure FormChangeBounds(Sender: TObject);
    procedure FormClick(Sender: TObject);
    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    procedure FormCreate(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure MeinEigenesOnClick(Sender: TObject);

  private
    { private declarations }
  public

  end;

var
  Form3: TForm3;

  txtzahl : integer;
  lblzahl : integer;
  absetzen : boolean;

implementation
uses
  FormularFrame, newformframetools;

{ TForm3 }
procedure TForm3.meineigenesOnClick(Sender: TObject);
var
   meinControl: TWinControl;
begin
 if (Sender is TWinControl) then
      meinControl := (Sender as TWinControl)
   else
      Exit;

   meinControl.Left := meinControl.Left - 2;
end;

procedure TForm3.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
  Form4.Close;
end;

procedure TForm3.FormCreate(Sender: TObject);
begin
  txtzahl :=0;
  lblzahl :=0;
  Memo1.Lines.Clear;
  absetzen :=false
end;

procedure TForm3.FormClick(Sender: TObject);
var
  toolmemo1i : integer;
  mausx, mausy : integer;
  Edit1 : TEdit;
  Label1 : TLabel;

begin
  toolmemo1i:=strtoint(Form4.Memo1.Lines[0]);

  mausx:=Mouse.CursorPos.x-Form3.Left-3;
  mausy:=Mouse.CursorPos.y-Form3.Top-50;

  case toolmemo1i of
  0: begin
  end;
  1: begin
      txtzahl:=txtzahl+1;
      Edit1 :=TEdit.Create(Form3);
      Edit1.Parent := Form3;
      Edit1.AutoSize:=true;
      Edit1.SetBounds(mausx,mausy,50,32);
      Edit1.Refresh;
      Edit1.Visible:=true;
      Edit1.Enabled:=true;
      Edit1.OnClick:=MeinEigenesOnClick;
      Edit1.Caption:=Form4.Edit1.Text;
      Edit1.Name:='txtFeld' + inttostr(txtzahl);
      Form4.Memo1.Lines.Text:='0';

      Memo1.Lines.Add('1');
      Memo1.Lines.Add(Edit1.Name);
      Memo1.Lines.Add(Edit1.Text);
      Memo1.Lines.Add(inttostr(Edit1.BoundsRect.Left));
      Memo1.Lines.Add(inttostr(Edit1.BoundsRect.Top));
      Memo1.Lines.Add(inttostr(Edit1.Width));
      Memo1.Lines.Add(inttostr(Edit1.Height));
      Memo1.Lines.Add('');
   // Memo1.Lines.Text:=inttostr(Form4.txtSize.Caption);
      Form3.Refresh;
  end;
  2: begin
      lblzahl:=lblzahl+1;
      Label1 :=TLabel.Create(Form3);
      Label1.Parent := Form3;
      Label1.AutoSize:=true;
      Label1.SetBounds(mausx,mausy,50,32);
      {if lblzahl>1 then
      begin
        for j:=1 to lblzahl do
        lblFeld
      end;}


      Label1.Refresh;
      Label1.Visible:=true;
      Label1.Enabled:=true;
      Label1.Font.Size:=strtoint(Form4.txtSize.Text);
      Label1.Caption:=Form4.Edit1.Text;
      Label1.Name:='lblFeld' + inttostr(lblzahl);
      Form4.Memo1.Lines.Text:='0';
      Form3.Refresh;

      Memo1.Lines.Add('2');
      Memo1.Lines.Add(Label1.Name);
      Memo1.Lines.Add(Label1.Caption);
      Memo1.Lines.Add(inttostr(Label1.BoundsRect.Left));
      Memo1.Lines.Add(inttostr(Label1.BoundsRect.Top));
      Memo1.Lines.Add(inttostr(Label1.Width));
      Memo1.Lines.Add(inttostr(Label1.Height));
      Memo1.Lines.Add('');

  end;
  3: begin

  end;
  end;
end;

procedure TForm3.FormChangeBounds(Sender: TObject);
begin
  Form4.SetBounds(Form3.Left-125,Form3.Top,115,201);
end;

procedure TForm3.Button1Click(Sender: TObject);

begin

   button1.Caption:=boolToStr(move);
end;

procedure TForm3.FormShow(Sender: TObject);
begin
  Form3.Caption:='Formular Editor';

  Form4:= TForm4.Create(Form3);
  Form4.ShowOnTop;
  Form4.Caption:='Tools';
  Form4.SetBounds(Form3.Left-125,Form3.Top,115,296);
end;

{$R *.lfm}

end.
  Mit Zitat antworten Zitat