BUG: Visible Property Malfunctions with ComboBox in Container
ID: Q161835
|
The information in this article applies to:
-
Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b, 5.0, 6.0
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.
MORE INFORMATIONSteps 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.
- Run the form and click on the command button. The container appears.
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.
Additional query words:
Keywords : kbVFp300bug kbVFp500bug kbVFp600bug FxprgGeneral
Version : WINDOWS:3.0,3.0b,5.0,6.0
Platform : WINDOWS
Issue type : kbbug
|