FormStyle := fsStayOnTop; //设置窗体

解决方案 »

  1.   

    我用上面的方法一直没有实现过,它只是在第一个窗口是有效,但如果我把FormStyle := fsStayOnTop放在第二窗口就没有效果了哈哈
      

  2.   

    ****如何将一个窗口做成Always on top?****Const HWND_TOPMOST = -1
    Const HWND_NOTOPMOST = -2
    Const SWP_NOSIZE = &H1
    Const SWP_NOMOVE = &H2
    Const SWP_NOACTIVATE = &H10
    Const SWP_SHOWWINDOW = &H40
    Private Declare Sub 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)Private Sub Form_Load()
    SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
    End Sub
      

  3.   

    HWND CreateWindowEx(    DWORD dwExStyle, // extended window style
        LPCTSTR lpClassName, // pointer to registered class name
        LPCTSTR lpWindowName, // pointer to window name
        DWORD dwStyle, // window style
        int x, // horizontal position of window
        int y, // vertical position of window
        int nWidth, // window width
        int nHeight, // window height
        HWND hWndParent, // handle to parent or owner window
        HMENU hMenu, // handle to menu, or child-window identifier
        HINSTANCE hInstance, // handle to application instance
        LPVOID lpParam  // pointer to window-creation data
       );Parameters
    dwExStyleWS_EX_TOPMOST Specifies that a window created with this style should be placed above all non-topmost windows and should stay above them, even when the window is deactivated. To add or remove this style, use the SetWindowPos function.
    用spy++看qq还有几种Style自己看吧!
      

  4.   

    创建AppBar类型窗体,使用Shell单元提供的功能是系统支持的,Delphi为提供可以作,D5开发人员自南上作了一个AppBar的向导但是那个向导生成的代码有点问题,自己看看,好久看了!
      

  5.   

    FormStyle := fsStayOnTop