sorry aber ich habe nicht genau verstaden was du meinst.
mein code sieht im moment so aus:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, ColorGrd, StdCtrls;
type
TForm1 = class(TForm)
PaintBox: TPaintBox;
Btn_Clearall: TButton;
procedure Mousmove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
procedure MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState;
X, Y: Integer);
procedure Btn_ClearallClick(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
x,y: integer;
implementation
{$R *.dfm}
procedure TForm1.Mousmove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if ssleft in shift then PaintBox.Canvas.LineTo(x,y);
end;
procedure TForm1.MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
PaintBox.Canvas.MoveTo(x,y);
end;
procedure TForm1.Btn_ClearallClick(Sender: TObject);
begin
PaintBox.Invalidate;
end;
end.