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 SWP_NOSIZE = & H1
Const SWP_NOMOVE = & H2
Private pOnTop 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
pOnTop = Setting
End Property
Private Property Get OnTop() As Boolean
OnTop = pOnTop
End Property
Private Sub Form_Load() ' 调用
OnTop() = True
End Sub
Const SWP_NOSIZE = & H1
Const SWP_NOMOVE = & H2
Private pOnTop 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
pOnTop = Setting
End Property
Private Property Get OnTop() As Boolean
OnTop = pOnTop
End Property
Private Sub Form_Load() ' 调用
OnTop() = True
End Sub