Why doesn't my custom control receive drag/drop events?

I figured out my mistake, so I'll answer it here in case someone else makes a similar mistake. It looks like I did hint at the answer in my question, though I didn't realize it at the time.

I figured out my mistake, so I'll answer it here in case someone else makes a similar mistake. It looks like I did hint at the answer in my question, though I didn't realize it at the time. In my question, I stated that I have tried setting AllowDrop = true both before the custom control's handle is created (via designer/constructor code) and after the handle is created (via OnHandleCreated override).

No difference in behavior. This is actually where the breakdown occurred. I failed to read the OnHandleCreated documentation that specifically states I needed to remember to call the base class' implementation of OnHandleCreated.

Reflector shows that Control::OnHandleCreated is responsible for setting up Control's internal event notification structure. I never called Control::OnHandleCreated, so the internal event notification structure was never getting properly built up. This eventing structure (reflector again shows) is responsible for firing OnDragOver, etc, so the missing eventing structure resulted in my missing events.

Answer: Be sure that you call the base class implementation of OnHandleCreated when you override it!

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions