c# 将项目拖动到另一个面板时忽略 MouseUp
我正在尝试将项目从 ItemList 拖到我的 TreeList 中。我编写了 listView1_MouseDown
、listView1_MouseMove
、treeView1_MouseMove
和 treeView1_MouseUp
函数。当我在 treeView1 边框内移动鼠标时,MouseMove 事件按预期进行处理。但 MouseUp 不会触发。我做错了什么吗?
I am trying drag an item from an ItemList to my TreeList. I wrote listView1_MouseDown
, listView1_MouseMove
, treeView1_MouseMove
and treeView1_MouseUp
functions. When I move the mouse within treeView1 borders, MouseMove event is handled as it was supposed to. But MouseUp doesn't fire. Am I doing something wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我记得,
MouseUp
事件被发送到与MouseDown
发送到的同一控件。因此,在您的情况下,您的listView1
将收到MouseUp
。您可能想研究一些其他事件,例如 拖放。
As far as I remember,
MouseUp
event is sent to the same control asMouseDown
was sent to. So, in your case, yourlistView1
will receiveMouseUp
.You might want to look into some other events, like DragDrop.