We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Mousecontroller woes

Thread ID:

Created:

Updated:

Platform:

Replies:

13791 May 11,2004 07:08 AM May 11,2004 10:33 AM Windows Forms 5
loading
Tags: GridControl
Don
Asked On May 11, 2004 07:08 AM

I'm trying to implement a mouse controller for my grid so I can change the cursor under various circumstances, but I'm having a little trouble. The grid has code in several of the mouse events, and when the mouse controller takes over, the grid's mouse events do not fire. Now, I think it would be relatively simple to fix the problem if I declared the MouseController object in my form WithEvents, then raised events in the mouse controller so that my form could handle them as if the grid itself fired them, but the IMouseController interface does not provide enough methods for that (for example, there is no DoubleClick method). Are there any sort of "best practices" for overcoming this problem? It all seems so complicated just to simply change a cursor.

Administrator [Syncfusion]
Replied On May 11, 2004 07:22 AM

You can also control the cursor by overriding OnSetCursor. Here is a KB that discusses this technique as well as the mousecontroller technique. http://www.syncfusion.com/Support/article.aspx?id=10444 If you want the grid''s other mouse controllers to control the mouse for some point, you can return 0 in your HitTest. But this would also allow them to control the cursor. So, if you just want to control the cursor, then maybe using an OnSetCursor override is the way to go.

Don
Replied On May 11, 2004 07:25 AM

I tried implementing this with the events that the MouseController could handle and I discovered that there are more problems. For one, when I click on a cell and the MouseController takes over, the current cell that was clicked on does not update. Would the MouseController have to do all this stuff (current cell, selections, etc.) manually? If so, yikes...

Don
Replied On May 11, 2004 07:26 AM

I'll check out that OnSetCursor thing. Thanks.

Don
Replied On May 11, 2004 07:45 AM

I don't know if the OnSetCursor solution is much better. I have to derive the grid and, therefore, can't work with it graphically at design-time. Ugh.

Administrator [Syncfusion]
Replied On May 11, 2004 10:33 AM

You can add a derived control to your toolbox if you put it in a class library.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;