Microsoft KB Archive/161835

= BUG: Visible Property Malfunctions with ComboBox in Container =

Article ID: 161835

Article Last Modified on 12/1/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q161835



SYMPTOMS
Attempting to set the Visible property of a container from the Valid event of a combo box inside the container causes unusual behavior. If you choose something from the combo box and move off the object, the container disappears but the combo box remains. The combo box is now inactive. However, if the combo box merely gains focus with no selection taking place, the container and its contents become invisible. You can change the Visible property of the container from a command button located on the form without difficulty.



RESOLUTION
Place the following command in the LostFocus event of the combo box: This.Parent.Visible=.F. Do not attempt to control the Visible property of the container from the Valid event of the combo box.



STATUS
Microsoft is researching this behavior and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Behavior
 Create a form. Place a container on the form. Set the Visible property of the Container to false (.F.). In the container, place a command button and a combo box.  Change the following combo box properties to the following values: RowSource=One,Two,Three RowsourceType=1-Value Valid Method Code: This.Parent.Visible=.f.                         In the command button change the following properties: Caption=One Click Event Code: This.Parent.Visible=.f.                         Place a command button on the form. Do not place this one in the container. Change the following properties on this object to the following: Caption=Two Click Event code: Thisform.container1.visible=.T.                       </li> Run the form and click on the command button. The container appears.</li></ol>

First, click the command button One and notice the container disappears. Click command button Two. Next, if you choose something from the combo box and move off the combo box object, the container disappears but the combo box remains; however, it is inactive. Press command button Two to show the container again. Finally, click on the combo box, make no selection, and press the Tab key. All objects in the container disappear.

Keywords: kbbug KB161835

-

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

© Microsoft Corporation. All rights reserved.