Change cursor using Cursor.Current and not this.Cursor

Topics: CAB & Smart Client Software Factory
Apr 23, 2007 at 7:24 AM
When building a simple Windows Forms application I can change the cursor using both Cursor.Current and this.Cursor. But it is not the case that I always have access to a this pointer with a Cursor property and therefore need to use the Cursor.Current property. However, I haven't been able to use Cursor.Current with CAB and smart parts. It simply doesn't change the cursor. Is there another way to change the cursor with CAB?
Apr 25, 2007 at 2:50 PM
I created an Infrastructure service that is available from all Module. One of the methods is 'WaitCursor(boolean)'. The service knows about the shell and can change the shell's cursor. Any module that wants to change the cursor, just grabs the service and calls the WaitCursor command. Seems to be working just fine for our applications.

Another method would be to create an event in the ShellForm to change the cursor. Other modules can send the event to cause the cursor to change.
May 3, 2007 at 3:08 AM
The service is a good solution. I was thinking about creating the service like tcochran64 suggested and adding a method to the Presenter<> base as well as a reference to the "cursor service". This way my presenters can simply call WaitCursor(true);

Thanks for the tip!