我如何拖动物品 [英] how do i drag an item

查看:66
本文介绍了我如何拖动物品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在制作基座,我希望能够在屏幕上拖动mt基座,但只希望能够通过按钮上的按钮来完成操作

hello i am making a dock and i want to be able to drag mt dock around my screen but only want to be able to do it from a button at the button how do i do this

 

 

推荐答案

修改并尝试

将其放入表单的构造函数中

put these in the Form's constructor

 

DragPanel.MouseDown + =新的MouseEventHandler(DragPanel_MouseDown);

DragPanel.MouseDown += new MouseEventHandler(DragPanel_MouseDown);

 

DragPanel.MouseMove + =新的MouseEventHandler(BarcodeControl_MouseMove);

DragPanel.MouseMove += new MouseEventHandler(BarcodeControl_MouseMove);

 

DragPanel.MouseUp + =新的MouseEventHandler(BarcodeControl_MouseUp);

DragPanel.MouseUp += new MouseEventHandler(BarcodeControl_MouseUp);

然后将以下代码添加到表单的类中
AND after that add the below code to the form's class


这篇关于我如何拖动物品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆