views:

202

answers:

4

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?

A: 

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.

Meta-Knight
A: 

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

Beth
+2  A: 

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);
MattH
+1. Interesting technique.
RichardOD
A: 

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

Simon