7,763
社区成员
发帖
与我相关
我的任务
分享
'frmMains
Option Explicit
Private Sub Command1_Click()
ShowWindow camera1.hWnd, SW_SHOWNOACTIVATE
End Sub
Private Sub Form_Load()
camera1.Show , Me
camera1.Hide
End Sub
Option Explicit
''使指定窗口总在最前
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
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1
Const SWP_NOZORDER = &H8
Sub SetFormTopmost(TheForm As Form)
SetWindowPos TheForm.hwnd, HWND_TOPMOST, 0, 0, 0, 0, _
SWP_NOZORDER + SWP_NOMOVE + SWP_NOSIZE
End Sub
Sub Form_Load()
SetFormTopmost Me ''只需要改动这里,ME换成你想放在最前的窗体名
End Sub