I have to set the custom image of cursor instead of predefined icon in c# winform.
But I want to set when system is busy or processing is happening in background and after completion his task then it back to its default setting.
I am using
private void button1_Click(object sender, EventArgs e)
{
Cursor.Current = new Cursor("D:\\hourglass.gif");
try
{
Thread.Sleep(5000); // wait for a while
}
finally
{
Cursor.Current = Cursors.Default;
}
}
here I define the hourglass.gif which is custom image. but it is through an error like below
"Argument 'picture' must be a picture that can be used as a Cursor. Parameter name: picture"
Can you please assist me how to resolve it.