c# - MouseDown event on a custom UserControl located on a FlowLayoutPanel -


i'm trying implement drag/drop in application. need able grab usercontrol (in case pipelinetask) programatically added flowlayoutpanel (which in it's turn located inside tabpage).

the method add pipelinetask flowlayoutpanels:

private void fillpipeline()     {         flowlayoutpanel1.controls.clear();         flowlayoutpanelnonissues.controls.clear();         foreach (fulltask task in pipelinetasks)         {             pipelinetask ts = new pipelinetask(task);             ts.mousedown += ts_mousedown;             if (task.tasktype == "driver issue")             {                 flowlayoutpanel1.controls.add(ts);             }             else             {                 flowlayoutpanelnonissues.controls.add(ts);             }         }     } 

the mousedown method:

private void ts_mousedown(object sender, mouseeventargs e)     {         pipelinetask ts = sender pipelinetask;         ts.dodragdrop(ts, dragdropeffects.move);     } 

but mousedown event not firing @ all. usercontrol has panel on fills whole usercontrol , i'm guessing might issue. there can me on this? if right above solution on how deal , grab usercontrol instead fine too. thanks

edit

i temporarely fixed issue removing panel filling usercontrol. problem. however, solution nice without having remove panel.

you subscribe panel's mousedown , raise custom event you'd creating on usercontrol, in turn gets handled ts_mousedown...


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -