Microsoft KB Archive/193400

= BUG: Show Event in a UserControl Array Member Does Not Execute =

Article ID: 193400

Article Last Modified on 5/13/2003

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q193400



SYMPTOMS
A control array of UserControls is created in a Standard EXE project. When the Visible property of a member of the UserControl array is set to True, the Show Event does not execute.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.



Steps to Reproduce Behavior
 Create a Standard EXE project in Visual Basic. Form1 is created default. Add an ActiveX Control project to the project group by completing the following steps:

 Select the File/Add project menu option to display the Add Project dialog box. In the New tab, select ActiveX Control. Click Open to close the Add Project dialog box. UserControl1 is created by default. </li>  Copy the following code in the Code window of UserControl1, and then close all windows associated with UserControl1 Option Explicit

Private Sub UserControl_Hide Debug.Print "HIDE" End Sub

Private Sub UserControl_Initialize Debug.Print "INIT" End Sub

Private Sub UserControl_Show Debug.Print "SHOW" End Sub </li> Add an instance of UserControl1 to Form1. Set the Index property of UserControl1 to 0.</li> Add a CommandButton to Form1.</li>  Copy the following code to the Code window of Form1: Option Explicit

Private Sub Command1_Click Load UserControl11(1) UserControl11(1).Visible = True UserControl11(1).Visible = False End Sub </li> Press the F8 key to step through each line of code until Form1 appears. After Form1 appears, click the Command1 CommandButton and press the F8 key to step through each event. Note that the Show event does not execute in response to clicking the CommandButton. The expected behavior is for the Show event to execute after the Initialize event.</li></ol>

Additional query words: kbDSupport kbDSD kbVBp kbCtrl kbVBp600bug kbActiveX

Keywords: kbbug KB193400

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.