You one thing to add - you can get the current mouse position with
MousePosition.X and MousePosition.Y.
Regards,
Peter Jausovec
(
http://blog.jausovec.net)
"Benny Raymond" <be***@pocketrocks.com> je napisal v sporocilo
news:%2****************@TK2MSFTNGP10.phx.gbl ...
All you would need to do is take the origin (where the mouse was) and take
the current mouse position, then figure out what the greatest difference
axis is: x or y something like this:
if (System.Math.Abs(origin.X - mouse.X) > System.Math.Abs(origin.Y -
mouse.Y))
{
// change in x is greater, now find left or right
if ((origin.X - mouse.X) < 0)
{
return "right";
}
else
{
return "left";
}
}
else
{
// change in y is greater, now find up or down
if ((origin.Y - mouse.Y) < 0)
{
return "up";
}
else
{
return "down";
}
}