Delphi-Quellcode:
case key of
38 : begin
if Shape1.Top > oben then
Shape1.Top := Shape1.Top - 4;
end;
//...
Oder eventuell besser:
if abs(Shape1.Top -oben) <= 3 then
PS: Ich gehe davon aus das Shape2 = Shape1 ist?
Also das das gleiche gemeint ist...
Gruß
Neutral General
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."