hello,
I´m trying to do a drag and drop operation and drag the control, just
like a windows icon, is that possible?
my control is a custom form, so I detect the mouseDown event and call
doDragAndDrop()
and override WndProc :
private const int WM_NCHITTEST = 0x84;
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_NCHITTEST && Control.MouseButtons==MouseButtons.Left)
{
System.Console.WriteLine("hit");
Point mousePos = Control.MousePosition;
mousePos.Offset(mouse_offset.X, mouse_offset.Y);
Location = mousePos;
}
else
base.WndProc(ref m);
}
where mouse_offset is initialized in mouseDown callBack
the dragging part is working without problems, but the control where it
is supposed to be dropped isn´t receiving the event, possibly because
the mouse is ove another control..
any comments?
thanks in advance
marcel