VBCE
6.0 does not support MODAL forms. You can simulate this however with a simple API
call and setting the original form to disabled. This is the same functionality can
be achieved with the VBCEMisc Control.

Place the following code in a MODULE:
Option Explicit
'Constants for topmost.
Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1
Public Const SWP_NOACTIVATE = &H10
Public Const SWP_SHOWWINDOW = &H40
Declare Function SetWindowPos Lib "Coredll" (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
On Form1, place a command button and enter the following code in the click event:
Private Sub Command1_Click()
Form1.Enabled = False
Form2.Show
End Sub
On Form2, place a command button and enter the following code in the click event:
Private Sub Command1_Click()
Form1.Enabled = True
Me.Hide
End Sub
Private Sub Form_Load()
'-- Makes this form "Always on Top..."
'-- Does not make it modal....
Call SetWindowPos(Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE
Or SWP_NOSIZE)
End Sub
|