Autor Beitrag
barana
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: So 20.03.05 16:04 
Hallo Leute,

ich weis nich wie ich in Dlephi ein Gegenstand (z.B. eine Image oder Button) programmiere der meinem Mauszeiger folgt. Bitte helft mir.

Dakne im Voraus

PS: Hab Delphi 6 falls relevant
LH_Freak
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 385

Win XP
D7 PE, D2k5 Trial
BeitragVerfasst: So 20.03.05 16:09 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
var
Mx,My: integer;

procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
MX := X;
MY := Y;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
if Image1.Left < MX then
  Image1.Left := Image1.Left + 1;
if Image1.Left > MX then
  Image1.Left := Image1.Left - 1;
if Image1.Top < MY then
  Image1.Top := Image1.Top + 1;
if Image1.Top > MY then
  Image1.Top := Image1.Top - 1;
end;


Hoffe das hat geholfen ;)
barana Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: Mo 21.03.05 10:27 
Jep, Danke.