当前位置:编程学习 > VB >>

大家帮我看下这个VB代码哪里错了,要怎么改?

Private Sub WinInTop(nWnd As Long, Optional InTop As Boolean) Const HWND_NoTopMost = -2 '取消在最前 Const HWND_TopMost = -1 '最上 Const SWP_NoSize = &H1 'wFlags 参数 Const SWP_NoMove = &H2 Const SWP_NoZorder = &H4 Const SWP_ShowWindow = &H40 Const SWP_HideWindow = &H80 Dim nIn As Long If InTop Then nIn = HWND_TopMost Else nIn = HWND_NoTopMost SetWindowPos , nWnd, nIn, 0, 0, 0, 0, SWP_NoSize + SWP_NoMove End Sub
答案:Private Sub WinInTop(nWnd As Long, Optional InTop As Boolean)
 Const HWND_NoTopMost = -2 '取消在最前
 Const HWND_TopMost = -1 '最上
 Const SWP_NoSize = &H1 'wFlags 参数
 Const SWP_NoMove = &H2
 Const SWP_NoZorder = &H4
 Const SWP_ShowWindow = &H40
 Const SWP_HideWindow = &H80
 Dim nIn As Long
 If InTop Then
 nIn = HWND_TopMost 
Else 
nIn = HWND_NoTopMost
end if
 SetWindowPos , nWnd, nIn, 0, 0, 0, 0, SWP_NoSize + SWP_NoMove
End Sub

上一个:VB中关于Inputbox和MsgBox的相关问题!
下一个:用1分,2分,5分共100枚硬币组成1.5元钱。用vb的方法表示所有的可能。

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,