Hi,
Is there a way to force a FORM to stay in
the background of all other FORMS in the
Application?
Printable View
Hi,
Is there a way to force a FORM to stay in
the background of all other FORMS in the
Application?
yes,
Make a timer on your form
and put this code in it.
Form1.zorder 1
Form1 loads in the background, but will goes on top
when clicked!
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.
TryCode: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
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?