Results 1 to 5 of 5

Thread: Quick question

  1. #1

    Thread Starter
    Member
    Join Date
    May 2000
    Location
    USA-TEXAS-DALLAS
    Posts
    34

    Cool

    Hmm, I cant seem to figure out how I can get my forms to stay on top or infront of all other applications even when they arnt the active window, Help!
    -Jeff
    Using VB 6.0 Enterprise
    I Still like to program on my TI-85!

  2. #2
    Guest
    To keep a form on top:

    Code:
    Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos"_
      (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
    
    Global Const SWP_NOMOVE = 2 
    Global Const SWP_NOSIZE = 1 
    Global Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE 
    Global Const HWND_TOPMOST = -1 
    Global Const HWND_NOTOPMOST = -2
    
    Private Sub Form_Load()
    ontop& = SetWindowPos(Me.hWnd, HWND_TOPMOST, _
    0, 0, 0, 0, FLAGS) 
    End Sub
    
    'Off top:
    
    ontop& = SetWindowPos (Me.hWnd, HWND_NOTOPMOST, _
    0, 0, 0, 0, FLAGS)

  3. #3
    Lively Member
    Join Date
    Aug 2000
    Location
    Texas
    Posts
    88
    Another way:

    Code:
    Form1.Show vbModal

  4. #4
    Guest
    Originally posted by sanon
    Another way:

    Code:
    Form1.Show vbModal
    That will work if you are looking to put the form in front of every other form, but it will not work when keeping your application on top of every other application.

  5. #5

    Thread Starter
    Member
    Join Date
    May 2000
    Location
    USA-TEXAS-DALLAS
    Posts
    34
    Thanks for the help
    -Jeff
    Using VB 6.0 Enterprise
    I Still like to program on my TI-85!

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