Public 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
SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, _
        SWP_NOMOVE Or SWP_NOSIZE

解决方案 »

  1.   

    http://www.csdn.net/develop/read_article.asp?id=18774
      

  2.   

    SetWindowPos Me.hwnd, 1, 0, 0, 0, 0, _
            SWP_NOMOVE Or SWP_NOSIZE
      

  3.   

    Static m_flag As Boolean
      m_flag = Not m_flag
      If m_flag = True Then  '最前
             SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
                      bfrmFlag = True
      Else  '普通
             SetWindowPos Me.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
                     bfrmFlag = False
      End If
      

  4.   

    Static m_flag As Boolean
      m_flag = Not m_flag
      If m_flag = True Then  '最前
             SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
                      bfrmFlag = True
      Else  '普通
             SetWindowPos Me.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
                     bfrmFlag = False
      End If
      

  5.   

    http://www.csdn.net/develop/read_article.asp?id=18774