I have a WinForms application that simply has one button. I created this application to demonstrate what is happening on a much larger application.
The button changes a boolean from true to false, and sets the mouse pointer.
private bool ChangeMouse = true;
private void button1_Click(object sender, EventArgs e)
{
Console.WriteLine("CURSOR-TOP: " + System.Windows.Forms.Cursor.Current.ToString());
if (ChangeMouse)
{
ChangeMouse = false;
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Cross;
}
else
{
ChangeMouse = true;
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
}
Console.WriteLine("CURSOR-BOTTOM: " + System.Windows.Forms.Cursor.Current.ToString());
Console.WriteLine("");
}
This is the result I get when i click the button 4 times:
CURSOR-TOP: [Cursor: Default]
CURSOR-BOTTOM: [Cursor: Cross]
CURSOR-TOP: [Cursor: Default]
CURSOR-BOTTOM: [Cursor: Default]
CURSOR-TOP: [Cursor: Default]
CURSOR-BOTTOM: [Cursor: Cross]
CURSOR-TOP: [Cursor: Default]
CURSOR-BOTTOM: [Cursor: Default]
As can be seen, the value for CURSOR-TOP is always the Default Cursor. Why is the change to the current cursor not maintained???