vb6.0如何让窗体跟随鼠标运动
2014-11-29 16:57
381 查看
首先将form的boderstyle属性设为0
Dim movesScreen As Boolean
Dim mousX As Integer
Dim mousY As Integer
Dim currX As Integer
Dim currY As Integer
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
movesScreen = True
mousX = X
mousY = Y
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If movesScreen Then
currX = Form1.Left - mousX + X
currY = Form1.Top - mousY + Y
Form1.Move currX, currY
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
movesScreen = False
End Sub
Dim movesScreen As Boolean
Dim mousX As Integer
Dim mousY As Integer
Dim currX As Integer
Dim currY As Integer
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
movesScreen = True
mousX = X
mousY = Y
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If movesScreen Then
currX = Form1.Left - mousX + X
currY = Form1.Top - mousY + Y
Form1.Move currX, currY
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
movesScreen = False
End Sub
相关文章推荐
- 如何让窗体跟随鼠标运动
- 原生js如何做一个链式运动,JavaScript怎么做鼠标跟随效果
- WPF实现无窗体鼠标跟随
- 如何通过鼠标控制无标头窗体
- C# 如何鼠标拖动无边框窗体
- 如何摁下鼠标左键,图标(窗体,或者控件)能够随着鼠标移动
- 【jQuery】一个跟随鼠标运动的图层
- [转]如何在视图中跟随鼠标移动显示曲线坐标
- 如何让一个div跟随鼠标移动
- [unity3d]如何实现游戏对象跟随鼠标方向移动
- Unity3D学习笔记02:GUI主角跟随鼠标运动
- [vb6.0] 模拟鼠标操作, 一个自用多次单击类,可单击窗体或屏幕
- 如何通过鼠标控制无标头窗体
- 通过鼠标事件来看QT/Embedded 窗体事件是如何派发的
- C# 如何鼠标拖动无边框窗体
- [unity3d]如何实现游戏对象跟随鼠标方向移动
- 如何实现窗体跟随另一个程序一起显示,一起隐藏!!
- 如何单击鼠标移动整个窗体
- VC对话框如何检测鼠标离开窗体的事件?
- Dom编程(图片 在 某一区域内 跟随鼠标运动、仅IE浏览器支持)