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
|