FIX: WriteProperties Event Fires IncorrectlyID: Q223101
|
A UserControl in a project always executes the WriteProperties event prior to the Resize event. According to Key UserControl Events in the product documentation at the URL below, the WriteProperties event only executes when the design-time instance of the control is destroyed or when a property value for the control is changed:
http://msdn.microsoft.com/library/devprods/vs6/vb/html/vbconwerenotinkansasanymore.htm
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article.
This bug was corrected in Visual Studio 6.0 Service Pack 3.
For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:
Q194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why
Q194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed
This section shows you how to create a sample project that demonstrates the bug behavior. The section assumes you are familiar with creating ActiveX controls and adding ActiveX controls to standard projects. If you are not familiar with these tasks, see the REFERENCES section below for more information.
Option Explicit
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
Debug.Print "read Properties"
End Sub
Private Sub UserControl_Resize()
Debug.Print "resize"
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Debug.Print "write Properties"
End Sub
resize
write Properties
resize
read Properties
The expected behavior is for the Resize Event to fire first, followed by the ReadProperties Event. The WriteProperties Event should not fire.
A similar bug behavior is documented in the following article in the Microsoft Knowledge Base:
Q223131 FIX: Inconsistent LostFocus Event Execution Between Versions
For more information, see the following topics:
Additional query words:
Keywords : kbActiveX kbCtrl kbVBp600bug kbGrpVB kbVS600sp3fix
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: May 20, 1999