Microsoft KB Archive/171504
Article ID: 171504
Article Last Modified on 11/18/2003
- Microsoft Visual Basic 5.0 Learning Edition
- Microsoft Visual Basic 5.0 Professional Edition
- Microsoft Visual Basic 5.0 Enterprise Edition
This article was previously published under Q171504
Setting the Caption property of a Property Page in the Property Page's Initialize or Click event causes an erroneous window to be displayed on the Property Page when the Builder (...) button is pressed for the "Custom" properties of an ActiveX control, or when the click event is fired. Additionally, the PropertyPage Caption property is not changed.
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been fixed in Visual Studio 97 Service Pack 2.
For more information on the Visual Studio 97 Service Pack 2, please see the following article in the Microsoft Knowledge Base:
170365 INFO: Visual Studio 97 Service Packs - What, Where, and Why
For a list of the Visual Basic 5.0 bugs that were fixed in the Visual Studio 97 Service Pack 2, please see the following article in the Microsoft Knowledge Base:
171554 INFO: Visual Basic 5.0 Fixes in Visual Studio 97 Service Pack 2
NOTE: While the problem of the additional window has been resolved, setting the caption property will work only in the Initialize event of the Property Page. Attempts to set the Caption property in the Click event of the Property Page will not be successful.
Steps to Reproduce Behavior
- Create a new ActiveX Control project.
- Place the following statement in the General Declarations of the UserControl:
Public aProperty As String
- From the Add-Ins menu, select Property Page Wizard.
NOTE: If this selection is not available, select Add-In Manager on the Add-Ins menu and check "VB Property Page Wizard."
- Click "Next" in the first Property Page Wizard Screen.
- In the second Property Page Wizard screen, click Add and then OK to add a Property Page named "PropertyPage1." Click Next.
- On the Third screen, double-click "aProperty" in the Available Properties list box. Click Next, then Finish, then OK, then Close.
Add the following code to the Property Page Initialize event:
PropertyPage.Caption = "New Caption"
- From the File menu, choose Make Project1.ocx.
- Save and close the project.
- Create a new "Standard EXE" project.
- Click Components on the Project menu and add a reference to Project1.
- Draw the UserControl on the Form.
- Click on the Builder Button (...) for the "Custom" property in the properties window.
- Note that an additional window is opened on top of the Property Page window.
NOTE: To reproduce this problem using the click event, place the code from step 7 in the Click event of the Property Page and repeat the remaining steps. This errant window will appear when you click on the Property Page.
Keywords: kbbug kbfix kbvbp500sp2fix kbvs97sp2fix KB171504