mouse drag & drop

99封情书 提交于 2019-12-08 07:53:14

问题


how to implement mouse drag&drop process example SetCursorPos(32, 32); mouse_event((uint)MouseEventFlags.RIGHTDOWN,0,0 ,0,0); mouse_event((uint)MouseEventFlags.RIGHTUP,0,0 ,0,0); SetCursorPos(38, 38); mouse_event((uint)MouseEventFlags.LEFTDOWN,0,0 ,0,0);
mouse_event((uint)MouseEventFlags.LEFTUP,0,0 ,0,0);

this is code for open whatever in topleft of the screen how to implement the drag & drop in this particular code or anyotherways?


回答1:


Here is Microsoft's Drag and Drop Overview

Forms .NET 1.1:

http://msdn.microsoft.com/en-us/library/ms973845.aspx

Forms .NET 2.0:

http://msdn.microsoft.com/en-us/library/za0zx9y0(VS.80).aspx

WPF:

http://msdn.microsoft.com/en-us/library/ms742859.aspx




回答2:


You would have to look into the Drag and Drop event(s) of the form, I think you need to enable OnEnter on the form aswell, its been a while since i've done windows forms programming.

Think it is called DragEnter, you can read more on the following pages:

http://vicky4147.wordpress.com/2007/02/04/a-simple-drag-drop-in-winforms/

c-sharpcorner

Other than that i'd look into uzbones answer



来源:https://stackoverflow.com/questions/581491/mouse-drag-drop

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!