Microsoft KB Archive/200296

= BUG: ComboBox Display Bleeds Through Pages in a PageFrame =

Article ID: 200296

Article Last Modified on 10/16/2002

-

APPLIES TO


 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q200296



SYMPTOMS
When you place a combo box control, which uses the InteractiveChange event to programmatically activate the first page of the pageframe, on the second page of a pageframe, when you select an item in that combo box the combo box display image bleeds through to the first page.



RESOLUTION
Here are two possible workarounds for this problem:


 * Use a Timer control to activate the first page.


 * Place code in the When event of the combo box to set its Visible property to false if the ActivePage of the pageframe is not the second page.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
  Place the following code into a Visual FoxPro program, and then run the program: DIMENSION laComboVals[2] laComboVals[1] = "Choice1" laComboVals[2] = "Choice2"

oForm = CREATEOBJECT('TestForm') oForm.VISIBLE = .T. READ EVENTS

DEFINE CLASS TestForm AS FORM ADD OBJECT pgfTest AS TestPageFrame

PROCEDURE DESTROY CLEAR EVENTS ENDPROC ENDDEFINE

DEFINE CLASS TestPageFrame AS PAGEFRAME TOP = 0 LEFT = 0

ADD OBJECT Page1 AS TestPage1 ADD OBJECT Page2 AS TestPage2 ENDDEFINE

DEFINE CLASS TestPage1 AS PAGE ADD OBJECT Text1 AS TEXTBOX ENDDEFINE

DEFINE CLASS TestPage2 AS PAGE ADD OBJECT cboTest1 AS TestCombo1 WITH ; TOP = 10 ADD OBJECT cboTest2 AS TestCombo2 WITH ; TOP = 40 ADD OBJECT cboTest3 AS TestCombo3 WITH ; TOP = 70 ADD OBJECT Timer1 AS Timer1 PROCEDURE CLICK THIS.cboTest2.VISIBLE = .T. ENDPROC ENDDEFINE

DEFINE CLASS TestCombo1 AS COMBOBOX LEFT = 5 ROWSOURCETYPE = 5 ROWSOURCE = "laComboVals"

PROCEDURE INTERACTIVECHANGE THIS.PARENT.PARENT.ACTIVEPAGE=1 THIS.PARENT.PARENT.Page1.Text1.SETFOCUS THISFORM.REFRESH ENDPROC ENDDEFINE

DEFINE CLASS TestCombo2 AS COMBOBOX LEFT = 5 ROWSOURCETYPE = 5 ROWSOURCE = "laComboVals" PROCEDURE INTERACTIVECHANGE THIS.PARENT.PARENT.ACTIVEPAGE=1 THIS.PARENT.PARENT.Page1.Text1.SETFOCUS THISFORM.REFRESH ENDPROC PROCEDURE WHEN IF This.Parent.Parent.ACTIVEPAGE <> 2 THIS.VISIBLE = .F.   ENDIF ENDPROC ENDDEFINE

DEFINE CLASS TestCombo3 AS COMBOBOX LEFT = 5 ROWSOURCETYPE = 5 ROWSOURCE = "laComboVals"

PROCEDURE INTERACTIVECHANGE THIS.PARENT.Timer1.ENABLED = .T. ENDPROC ENDDEFINE

DEFINE CLASS Timer1 AS TIMER INTERVAL = 10

PROCEDURE TIMER THIS.PARENT.PARENT.ACTIVEPAGE=1 THIS.PARENT.PARENT.Page1.Text1.SETFOCUS THISFORM.REFRESH THIS.ENABLED = .F. ENDPROC ENDDEFINE  Select an item from each of the combo boxes on page two. The results are:

 The first (topmost) combo box bleeds through to the first page.

 The second combo box uses the When event solution so it does not bleed through to the first page.

 The third combo box uses the Timer solution so it also does not bleed through to the first page.</ul> </li></ol>

Keywords: kbbug kbnofix kbcodesnippet kbcontainer kbctrl KB200296

-

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

© Microsoft Corporation. All rights reserved.