标题:[分享]移动无标题窗口的代码(非API编写)
只看楼主
ioriliao
Rank: 7Rank: 7Rank: 7
来 自:广东
等 级:贵宾
威 望:32
帖 子:2829
专家分:647
注 册:2006-11-30
结帖率:78.95%
 问题点数:0 回复次数:0 
[分享]移动无标题窗口的代码(非API编写)

Dim mouseX, mouseY, currX, currY As Single
Dim flag As Boolean
Private Sub Form_Load()
flag = False
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
mouseX = X
mouseY = Y
flag = True

End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbKeyLButton And flag = True Then
currX = Me.Left - mouseX + X
currY = Me.Top - mouseY + Y
Me.Move currX, currY
End If
End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
flag = False
End Sub

[此贴子已经被作者于2006-12-9 20:06:54编辑过]

搜索更多相关主题的帖子: 分享 编写 代码 窗口 API 
2006-12-09 20:06



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-108425-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.200237 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved