I have written a flashy custom context menu using a new form with layeredwindows for my application, I want the context menu form to close when the mouse leaves the form, or when its deactivated. But I can't seem to get it to happen. I have tried the Close() method in the deactivated event handler, in the Mouse leave event, in the form leave event. I'm just not sure how to go about it.
i tried to create a nativewindow class that would watch for the capturechanged message and close the form, but the form never receives that message.
Any pointers or workarounds?