VB编程技巧:让窗口一直在上面
时 间:2008-05-15 08:11:43
作 者:UMVSOFT整理 ID:16 城市:江阴
摘 要:VB编程技巧:让窗口一直在上面
正 文:
让窗口一直在上面 '很多流行软件都有这样一个选项:Always on Top。它可以让窗口在最上面,别的窗口不能覆盖它。我们在VB 中,可以使用下面的方法来实现: Private Const SWP_NOSIZE = &H1 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOZORDER = &H4 Private Const SWP_NOREDRAW = &H8 Private Const SWP_NOACTIVATE = &H10 Private Const SWP_FRAMECHANGED = &H20 Private Const SWP_SHOWWINDOW = &H40 Private Const SWP_NOCOPYBITS = &H80 Private Const SWP_NOOWNERZORDER = &H200 Private Const SWP_DRAWFRAME = SWP_FRAMECHANGED Private Const SWP_NOREPOSITION = SWP_NOOWNERZORDER Private Const HWND_TOP = 0 Private Const HWND_BOTTOM = 1 Private Const HWND_TOPMOST = -1 Private Const HWND_NOTOPMOST = -2 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 Private mbOnTop As Boolean Private Property Let OnTop(Setting As Boolean) If Setting Then SetWindowPos hwnd, -1, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE Else SetWindowPos hwnd, -2, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE End If mbOnTop = Setting End Property Private Property Get OnTop() As Boolean 'Return the private variable set in Property Let OnTop = mbOnTop End Property '调用 OnTop=True 即可让窗口 Always OnTop。
Access软件网QQ交流群 (群号:54525238) Access源码网店
常见问答:
技术分类:
源码示例
- 【源码QQ群号19834647...(12.17)
- 统计当月之前(不含当月)的记录...(03.11)
- 【Access Inputbo...(03.03)
- 按回车键后光标移动到下一条记录...(02.12)
- 【Access Dsum示例】...(02.07)
- Access对子窗体的数据进行...(02.05)
- 【Access高效办公】上月累...(01.09)
- 【Access高效办公】上月累...(01.06)
- 【Access Inputbo...(12.23)
- 【Access Dsum示例】...(12.16)

学习心得
最新文章
- 仓库管理实战课程(9)-开发往来单...(04.02)
- 仓库管理实战课程(8)-商品信息功...(04.01)
- 仓库管理实战课程(7)-链接表(03.31)
- 仓库管理实战课程(6)-创建查询(03.29)
- 仓库管理实战课程(5)-字段属性(03.27)
- 设备装配出入库管理系统;基于Acc...(03.24)
- 仓库管理实战课程(4)-建表操作(03.22)
- 仓库管理实战课程(3)-需求设计说...(03.19)
- 仓库管理实战课程(2)-软件背景和...(03.18)
- 仓库管理实战课程(1)-讲师介绍(03.16)