-1

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.

5

1 Answer 1

0

Consider converting the gif to a cursor:

http://www.gdgsoft.com/anituner/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.