PRB: VBCE: Deactivate Event Fires when Second Form is Closed (250475)
The information in this article applies to:
- Microsoft Windows CE Toolkit for Visual Basic 6.0
This article was previously published under Q250475 SYMPTOMS
After closing a form that has been shown on top of another form, the Deactivate event of the form that is being closed fires. This occurs only when the application is run on the remote device.
RESOLUTION
To work around this behavior, a form level variable can be used to determine when the event should fire. The following example sets the form level variable in the QueryUnload event so that the Deactivate event does not fire:
Dim FireDeactivateEvent
Private Sub Form_Deactivate()
If FireDeactivateEvent Then
MsgBox "Deactivate"
End If
End Sub
Private Sub Form_Load()
FireDeactivateEvent = True
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
FireDeactivateEvent = False
End Sub
Modification Type: | Major | Last Reviewed: | 10/2/2003 |
---|
Keywords: | kbprb kbToolkit KB250475 |
---|
|