Results 1 to 3 of 3

Thread: FORM ALWAYS ON TOP??????????

  1. #1

    Thread Starter
    Addicted Member g.mie's Avatar
    Join Date
    Jan 2001
    Location
    EarTh
    Posts
    134

    Unhappy

    HELOW THERE

    I WANT ASK SOMTHING. WHAT SHOULD I DO TO MAKE FORM ALWAYS ON TOP.

    TQ

  2. #2
    Guest

    SetWindow Pos API

    Put this in a module

    Code:
    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
    
    Public Const HWND_TOPMOST = -1
    Public Const FLAGS = &H2 Or &H1
    
    Sub StayOnTop(Form As Form)
        Dim SetWinOnTop As Long
        SetWinOnTop = SetWindowPos(Form.hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
    End Sub
    To make the form stay on top, do this
    Code:
    StayOnTop Form1
    Need more help? Ask me

    [Edited by Jason Foral on 01-07-2001 at 03:26 PM]

  3. #3
    Guest
    Add the following to the Form you want to stay on top.
    Code:
    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
    Private Sub Form_Load()
        SetWindowPos hWnd, -1, 0, 0, 0, 0, 3
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width