| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 566 人关注过本帖
标题:[分享]移动无标题窗口的代码(非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
快速回复:[分享]移动无标题窗口的代码(非API编写)
数据加载中...
 
   



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

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