我们注意到一些奇怪的 Cursor 行为,我们怀疑这是我们的 Cursor canging 方法之一的结果。只是有时,我们的电脑一直显示 SizeAll 光标。无处不在,在每个应用程序中。现在,我们从不在代码中的任何地方使用 SizeAll 游标,但我们可以在执行以下代码时“解开”游标。
我们怀疑问题出在静态光标属性上,但无法识别错误。
代码有什么问题?
不过还是谢谢大家。
static class GlobalVars
{
private static Cursor handOpenCursor;
public static Cursor HandOpenCursor
{
get
{
if (handOpenCursor == null)
{
string cursorPath = System.IO.Path.Combine( ApplicatiePaths.ImagePath, @"hand_open.cur" );
handOpenCursor = new Cursor(cursorPath);
return handOpenCursor;
}
else
{
return handOpenCursor;
}
}
set
{
handOpenCursor = value;
}
}
}
.....
private static void panel_MouseUp(object sender, MouseEventArgs e)
{
((Control)sender).Cursor = GlobalVars.HandOpenCursor;
}