Post by GilesIs there an event that occurs when a VB form has fully loaded and
displayed? (like the onload event in javascript)
No there isn't.
If the Form is explicitly shown and any routine calls 'DoEvents' before
the 'Form_Load' ends, the Form will be fully loaded and displayed after the
last sentence of the 'Form_Load' event. Otherwise it will be fully loaded
and displayed at the first 'Form_Activate' notification:
'*****************
Public Event LoadComplete(ByVal CompletedOn As LoadCompleteConstants)
Public Enum LoadCompleteConstants
OnActivate
OnLoad
End Enum
Private m_Loaded As Boolean
Private m_Activated As Boolean
Private Sub Form_Activate()
If m_Activated = False Then
If m_Loaded = True Then RaiseEvent LoadComplete(OnActivate)
m_Activated = True
End If
'
'···
End Sub
Private Sub Form_Load()
'···
'
If m_Activated = True Then RaiseEvent LoadComplete(OnLoad)
m_Loaded = True
End Sub
'*****************
--
Regards
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
( ! ) http://groups.google.com/group/microsoft.public.vb.general.discussion
( i ) http://www.microsoft.com/communities/conduct/default.mspx
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -