c# - React to dropping item out of Control with AllowDrop = true -


i'm new handling drag-n-drop events in c# , i've confronted problem.

i have winforms project form containing button , panel. i've set panels allowdrop property true , added handler dragdrop event:

panel1.dragdrop += new drageventhandler(panel1_dragdrop); 

for button i've added mousedown event handler initializes dragdropeffects:

    void btn1_mousedown(object sender, mouseeventargs e)     {         (sender button).borderstyle = system.windows.forms.borderstyle.fixed3d;         dragdropeffects dde1 = dodragdrop((sender button), dragdropeffects.all);     } 

i have no problem dragdrop event raised panel;

my question how can handle event of user dropping item outside area allowdrop property set true? suppose want set buttons borderstyle fixedsingle when user while perfoming dragging releases mouse button outside of panel - event should handle?

handle panel's dragleave event.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -