Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 97887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:05:26+00:00 2026-05-11T00:05:26+00:00

Is there a difference between Cursor.Current and this.Cursor (where this is a WinForm) in

  • 0

Is there a difference between Cursor.Current and this.Cursor (where this is a WinForm) in .Net? I’ve always used this.Cursor and have had very good luck with it but I’ve recently started using CodeRush and just embedded some code in a ‘Wait Cursor’ block and CodeRush used the Cursor.Current property. I’ve seen on the Internet and at work where other programmers have had some problems with the Cursor.Current property. It just got me to wondering if there is a difference in the two. Thanks in advance.

I did a little test. I have two winforms. I click a button on form1, set the Cursor.Current property to Cursors.WaitCursor and then show form2. The cursor doesn’t change on either form. It remains Cursors.Default (pointer) cursor.

If I set this.Cursor to Cursors.WaitCursor in the button click event on form1 and show form2, the wait cursor only shows on form1 and the default cursor is on form2 which is expected. So, I still don’t know what Cursor.Current does.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T00:05:27+00:00Added an answer on May 11, 2026 at 12:05 am

    Windows sends the window that contains the mouse cursor the WM_SETCURSOR message, giving it an opportunity to change the cursor shape. A control like TextBox takes advantage of that, changing the cursor into a I-bar. The Control.Cursor property determines what shape will be used.

    The Cursor.Current property changes the shape directly, without waiting for a WM_SETCURSOR response. In most cases, that shape is unlikely to survive for long. As soon as the user moves the mouse, WM_SETCURSOR changes it back to Control.Cursor.

    The UseWaitCursor property was added in .NET 2.0 to make it easier to display an hourglass. Unfortunately, it doesn’t work very well. It requires a WM_SETCURSOR message to change the shape and that won’t happen when you set the property to true and then do something that takes a while. Try this code for example:

    private void button1_Click(object sender, EventArgs e) {   this.UseWaitCursor = true;   System.Threading.Thread.Sleep(3000);   this.UseWaitCursor = false; } 

    The cursor never changes. To whack that into shape, you’ll need to use Cursor.Current as well. Here is a little helper class to make it easy:

    using System; using System.Windows.Forms;  public class HourGlass : IDisposable {   public HourGlass() {     Enabled = true;   }   public void Dispose() {     Enabled = false;   }   public static bool Enabled {     get { return Application.UseWaitCursor; }     set {       if (value == Application.UseWaitCursor) return;       Application.UseWaitCursor = value;       Form f = Form.ActiveForm;       if (f != null && f.Handle != IntPtr.Zero)   // Send WM_SETCURSOR         SendMessage(f.Handle, 0x20, f.Handle, (IntPtr)1);     }   }   [System.Runtime.InteropServices.DllImport('user32.dll')]   private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, IntPtr lp); } 

    And use it like this:

    private void button1_Click(object sender, EventArgs e) {   using (new HourGlass()) {     System.Threading.Thread.Sleep(3000);   } } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 87k
  • Answers 87k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Visual Studio has a notion of layouts but they are… May 11, 2026 at 5:30 pm
  • Editorial Team
    Editorial Team added an answer EDIT: too bad, though all seemed fine in the preview,… May 11, 2026 at 5:30 pm
  • Editorial Team
    Editorial Team added an answer When I do this pattern I have a showDirtyPrompt on… May 11, 2026 at 5:30 pm

Related Questions

I'm developing a Flex 2 application, and I noticed that part of the library
Is there a difference between NULL and null in PHP? Sometimes they seem to
Is there a difference between just saying throw; and throw ex; assuming ex is
Is there a difference between generating multiple numbers using a single random number generator

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.