Member Avatar for Thew
Thew

Hi,
I've made a custom month view calendar control but I'm having a problem in my custom day event drag code. I don't use any of the drag and drop in winforms, basically I just override the OnMouseDown, OnMouseUp, OnMouseMove methods and listen for appropriate actions to get my own drag and drop working. It works like a charm but when I implemented something like an expand button that shows all the hidden events and made it to be able to handle drag and drop in the same way as the underlaying calendar control, I found a problem. The hidden events are shown in a "small dayview component" within a popup window. When user starts dragging an event, the control will call the parent (popup window) to close itself and fires an event inside the day cell of the main calendar window, so it knows that the user wants to drag something. But the main calendar window just doesn't focus. I tried to set focus on the calendar control but it didn't help. It just won't receive any of the messages that I need to process my drag and drop correctly until user releases mouse button...

here is the preview and layout of my control:
http://www.upnito.sk/imggal.php?viewGallery=281af838327360cade2d4ad42941002c