Results 1 to 6 of 6

Thread: -1 * (vbModal)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    116

    Exclamation

    Hi,
    Is there a way to force a FORM to stay in
    the background of all other FORMS in the
    Application?
    0101011001000010
    01101111011011100110110001101001011011100110010101110010

  2. #2
    Frenzied Member
    Join Date
    Sep 1999
    Location
    Phoenix, az
    Posts
    1,517
    yes,


    Make a timer on your form
    and put this code in it.

    Form1.zorder 1

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    116

    Post

    Form1 loads in the background, but will goes on top
    when clicked!
    0101011001000010
    01101111011011100110110001101001011011100110010101110010

  4. #4
    Lively Member
    Join Date
    May 2000
    Location
    Norway
    Posts
    112
    Maybe if there is a way to do this in another way.
    Use some API to set that Form Window as a parent to the other Forms(and define those other forms as Popup windows?).

    Just a thought.

  5. #5
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177
    Try
    Code:
    Option Explicit
    
    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 Const SWP_NOMOVE = &H2
    Private Const SWP_NOSIZE = &H1
    Private Const HWND_BOTTOM = 1
    
    Private Sub Form_Load()
        Timer1.Interval = 10
    End Sub
    
    Private Sub Timer1_Timer()
        SetWindowPos hwnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
    End Sub

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    116

    Post

    Hi Aaron,

    With your code, the Background FORM stays
    in the back and the FORM that appears on
    top stays on top...

    BUT, the TOP FORM becomes ineffective
    because wherever I click on the TOP FORM
    (including CONTROLS), the TOP FORM blinks
    for 10 milli seconds preventing the trigerring
    of any method related to the TOP FORM
    (i.e. Untouchable TOP FORM).

    Any suggestions?
    0101011001000010
    01101111011011100110110001101001011011100110010101110010

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