Simon
Simon

Reputation: 6152

Unwanted wait cursor in WinForms app

I have an MDI WinForms app in which the MDI parent form has a ToolStrip, MenuStrip and StatusStrip. Whenever the mouse is moved over one of these controls the cursor changes to a 'wait' cursor (a arrow with an hourglass). This seems to be default behaviour in that there is no code to make this happen. The UseWaitCursor property of both the ToolStrip and MenuStrip is false; StatusStrip does not have this property.

This occurs in both debug and release builds and confuses the users who think that the app is 'doing' something when really it isn't!

Does anyone know what is causing this to happen, and more importantly how to make it stop?

Upvotes: 0

Views: 2392

Answers (4)

Simon
Simon

Reputation: 6152

Stupid me. I had an unwanted line of code in a finally statement setting the cursor to AppStarting.

Upvotes: 0

MattH
MattH

Reputation: 4227

It sounds like it must have been changed in a property sheet, suggest checking the designer.cs if you've already checked your own code.

Failing that, do some digging. Try running the following extract on the form and see if it returns any results:

var theCulprit = this.Controls.Cast<Control>().Where(ctrl => ctrl.UseWaitCursor);

Upvotes: 3

Beth
Beth

Reputation: 9607

I'm not seeing the same thing in my MDI app. Try creating a new project, adding only those controls, and running. If no cursor appears, there's something else going on.

HTH

Upvotes: 0

Meta-Knight
Meta-Knight

Reputation: 17845

The three controls have a Cursor property which changes the cursor's appearance when the mouse is over the control. Make sure this property is set to default and isn't changed in your code.

Upvotes: 0

Related Questions