VB编写的程序怎样总保持在所有窗口前面?
1个回答
展开全部
呵呵,只要有这些代码就能让你的程序在前面了:
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
Const
HWND_TOPMOST
=
-1
Private
Sub
Form_Load()
SetWindowPos
Me.hwnd,
HWND_TOPMOST,
Me.Left
/
Screen.TwipsPerPixelX
_
,
Me.Top
\
Screen.TwipsPerPixelY,
Me.Width
\
Screen.TwipsPerPixelX,
_
Me.Height
\
Screen.TwipsPerPixelY,
0
End
Sub
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
Const
HWND_TOPMOST
=
-1
Private
Sub
Form_Load()
SetWindowPos
Me.hwnd,
HWND_TOPMOST,
Me.Left
/
Screen.TwipsPerPixelX
_
,
Me.Top
\
Screen.TwipsPerPixelY,
Me.Width
\
Screen.TwipsPerPixelX,
_
Me.Height
\
Screen.TwipsPerPixelY,
0
End
Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询