- 生肖
- 猴
- 星座
- 处女座
- 性别
- 男
- 积分
- 680
- 积分
- 1161
- 精华
- 1
- 阅读权限
- 70
- 注册时间
- 2012-5-3
- 最后登录
- 2016-9-22
- 帖子
- 136
- 生肖
- 猴
- 星座
- 处女座
- 性别
- 男
|
本帖最后由 sky_yx 于 2015-12-30 14:22 编辑
- '把以下代码加入模块中
- Private Const HWND_TOPMOST = -1
- Private Const SWP_NOACTIVATE = &H10
- Private Const SWP_SHOWWINDOW = &H40
- Private Const SWP_HIDEWINDOW = &H80
- Private Const SWP_NOZORDER = &H4
- Private Const SWP_NOMOVE = &H2
- Private Const SWP_NOREPOSITION = &H200
- Private Const SWP_NOSIZE = &H1
- Private Declare Function SetWindowPos Lib "user32 " (ByVal hwnd As Long, _
- ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, _
- ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
- 'TopMostForm
- '若Top=true,使窗口始终位于屏幕最上层
- '当Top=false时,取消这一属性
- Public Sub TopMostForm(f As Form, Top As Boolean)
- If Top Then
- SetWindowPos f.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE
- Else
- SetWindowPos f.hwnd, 0, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE
- End If
- End Sub
复制代码
|
|