Results 1 to 3 of 3

Thread: Form problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    8

    Thumbs up

    I want the form always on the top of the screen and visible
    to the users whenever the other windows open.

    How can I do that? Is there any property of the form i can
    set for that?

    Thanks in advance.

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    'to make form stay topmost
    
    'put this in a bas module
    '
    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
    
    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
    
    '=============================================
    '
    'put this in events click or load or whatever
    'or hardcopy
    'To set Form1 as a TopMost form, do the following:
    
    res& = SetWindowPos (Form1.hWnd, HWND_TOPMOST, _
    0, 0, 0, 0, FLAGS) 
    'if res&=0, there is an error
    
    'To turn off topmost (make the form act normal again):
    
    res& = SetWindowPos (Form1.hWnd, HWND_NOTOPMOST, _
    0, 0, 0, 0, FLAGS)
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    8

    Smile

    Thanks. It works.

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