Autor Beitrag
deki123
Hält's aus hier
Beiträge: 6



BeitragVerfasst: Do 08.12.05 13:58 
Hallo, ich hab ein kleines Problem.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
procedure keycheck;
begin
  while true do
    begin
      if boolean(getasynckeystate(vk_left)) then
        form1.shape1.left:= form1.shape1.left -50;
      if boolean(getasynckeystate(vk_right)) then
        form1.Shape1.left:= form1.Shape1.Left +50;
      if boolean(getasynckeystate(vk_up)) then
        form1.shape1.Top :=form1.shape1.Top -50;
      if boolean(getasynckeystate(vk_down)) then
        form1.shape1.top:= form1.shape1.top +50;
  end;
end;


Ich möchte Shape1 nur verschieben. Shape1 wird zwar an der neuen Position angezeigt, ist aber auch immer noch auf der alten Positon zu sehen. Wie kann ich die alte Positon löschen?

Arbeite erst sehr kurz mit Delphi,
Vielen Danke jür jede Hilfe.

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt.
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Do 08.12.05 14:01 
(1) hier gibts es Code-Tags
(2) in der Schleife mal
ausblenden Delphi-Quelltext
1:
Application.ProcessMessages;					
aufrufen

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
Ivo@CoMRoK
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 258

Win XP
D3 Prof., D7 Pe.
BeitragVerfasst: Fr 09.12.05 22:09 
Ich hab mal sowas ähnliches mit nem Image gemacht:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Timer1.Interval := 40;
 if getAsyncKeyState(Ord('A'))<0 then
   begin
     Image1.Left := Image1.Left - 4;
   end;
 if getAsyncKeyState(Ord('W'))<0 then
   begin
     Image1.Top := Image1.Top - 4;
   end;
 if getAsyncKeyState(Ord('S'))<0 then
   begin
     Image1.Top := Image1.Top + 4;
   end;
 if getAsyncKeyState(Ord('D'))<0 then
   begin
     Image1.Left := Image1.Left + 4;
   end;
end;


Ob das mim Shape auch funzt weiß ich net sonst machs halt mim Image.

mfg Ivo

_________________
Fällt der Bauer tot vom Traktor, stand am Waldrand ein Reaktor.
Ein altes indianisches Sprichwort besagt:Es kann gefährlich sein gelben Schnee zu essen.