java怎么导入图片 如何使vb的窗体在电脑屏幕上随鼠标一起移动?
浏览量:1884
时间:2021-03-12 14:14:36
作者:admin
如何使vb的窗体在电脑屏幕上随鼠标一起移动?
将以下代码放入表单代码:private mmousedown as Boolean private MX as single,my as singleprivate sub formuload()mMouseDown=false结束子私有子窗体umousedown(Button as Integer,Shift as Integer,X as Single,Y as Single)mMouseDown=Not mMouseDownmX=XmY=YEnd子私有子窗体umousemove(Button as Integer,Shift as Integer,X as Single,Y as Single)如果mMouseDown我。快走我。左边X-mX 我。顶Y-myend sub单击窗体后,窗体将随鼠标移动,然后再次单击以停止跟随。鼠标将停留在单击的位置(窗体上)。MouseMove事件不是很敏感,因此鼠标不能移动太快。
版权声明:本文内容由互联网用户自发贡献,本站不承担相关法律责任.如有侵权/违法内容,本站将立刻删除。