-1
基本上我想移动我的鼠标,直到角度匹配。 这是我走到这一步(不工作):for循环直角匹配C#
for (eyeangle != angleVert)
{
if (eyeangle < angleVert)
{
this.Cursor = new Cursor(Cursor.Current.Handle);
Cursor.Position = new Point(Cursor.Position.X, Cursor.Position.Y - 10);
}
if (eyeangle > angleVert)
{
this.Cursor = new Cursor(Cursor.Current.Handle);
Cursor.Position = new Point(Cursor.Position.X, Cursor.Position.Y + 10);
}
}
什么是做到这一点的正确方法?
你必须有某种数组或集合的迭代来 – jmc
好了,所以我会做类似:'的for(int i = 0; angleVert = eyeangle; i ++){if(eyeangle
我想你可能想要一个'while'循环,但要小心:如果你的逻辑不好,你会以无限循环结束。你需要确保条件最终肯定是真的,或者你有办法打破循环 – musefan