Autor Beitrag
christian87
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: Do 08.02.07 13:30 
Also wie schon gesagt ich will das onmousemove per Befehl wieder aktivieren.
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 08.02.07 13:35 
Du musst dem Ereignis wieder die entsprechende Methode zuweisen.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm2.PaintBox1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  DoSomething;
end;

{...}

paintbox1.MouseMove := PaintBox1MouseMove;

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
christian87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: Do 08.02.07 13:41 
Also irgendwie haut das noch nicht hin. Also onmousemove soll aktiviert werden, wenn ich auf nen Button klicke.
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 08.02.07 13:42 
Ohne Deinen Quellcode zu kennen, kann man Dir da wohl nicht helfen :-)

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
christian87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: Do 08.02.07 13:46 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
procedure TForm1.Neu1Click(Sender: TObject);
begin
//hier soll onmousemove aktiviert werden
x0:=1;
x1:=199;
y0:=1;
y1:=399;
bx:=100;
by:=350;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
paintbox1.OnMouseMove:=nil;
end;

end.
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 08.02.07 13:47 
Und wo ist die Methode, welche bei OnMouseMove ausgeführt werden soll?

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
christian87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: Do 08.02.07 13:57 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
procedure TForm1.PaintBox1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin

label1.caption:=inttostr(x);
label2.Caption:=inttostr(y);

Loesche_Hintergrund;
Zeichne_Ball;

paintbox1.canvas.MoveTo(bx+8,by+8);
paintbox1.Canvas.LineTo(x,y);

procedure TForm1.Neu1Click(Sender: TObject);
begin
paintbox1:=paintbox1.OnMouseMove;
x0:=1;
x1:=199;
y0:=1;
y1:=399;
bx:=100;
by:=350;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
paintbox1.OnMouseMove:=nil;
end;
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 08.02.07 15:18 
Also zuerst einmal fehlt da ein "end;" bei der ersten Prozedur.

Dann das hier:
ausblenden Delphi-Quelltext
1:
paintbox1:=paintbox1.OnMouseMove;					

Mein Quelltext sah da ganz oben ein bisschen anders aus ;-) Du versuchst hier, der Paintbox selber (also einem Objekt vom Typ TPaintBox) eine Prozedur zuzuweisen. Das kann doch gar nicht klappen :-) Du musst dem Ereignis die Prozedur zuweisen, wie ich das in meinem ersten Quelltext getan habe.

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".