I’m using the AutoScroll functionality in System.Windows.Forms.Panel to build a custom scrollable control. Everything is working fine, apart from the fact that when I hover over the scroll bars the cursor changes to a ‘busy’ cursor. It doesn’t seem to be possible to override this behaviour since I can’t get hold of the scrollbar instances (they’re inside the ScrollableControl base class). I’ve tried setting Application.UseWaitCursor to false, but that doesn’t change anything.
It might be worth mentioning that this control is running inside an ActiveX control, which in turn is running inside Outlook. Everything else works as expected, just this little thing is throwing me off…
Any ideas? All help appreciated!
Troubleshoot this with Spy++, pay attention to the WM_SETCURSOR message. A scrollbar doesn’t have any reason to change the cursor, you’ll see it return FALSE (shown as ‘fHaltProcessing:False in the Spy++ trace). Which cause the message to be sent to the parent of the control. Follow the trace, eventually you’ll run into a parent window that returns TRUE. That’s the one that changed the cursor.
Odds are decent that this will be Outlook. No idea from your question why it thinks the UI is dead. Deriving your own class from Panel and overriding WndProc() to catch the message would be a workaround of sorts. I would however definitely focus on Outlook first.