Article ID: 221613 - Last Review: October 16, 2002 - Revision: 1.1

FIX: Clicking Page Tab Executes Container Click Event

This article was previously published under Q221613

On This Page

Expand all | Collapse all

SYMPTOMS

A form's Click event fires when both it and the Click event of individual pages of a pageframe contain code. The page's Click event should be the only event that fires.

STATUS

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

This bug was corrected in Visual Studio 6.0 Service Pack 3.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a program that contains the following code:
    frmMyForm = CREATEOBJECT("mytestform")
    frmMyForm.SHOW(1)
    
    DEFINE CLASS mytestform AS FORM
    	CAPTION= "Click on the Page Tabs"
    
    	ADD OBJECT pageframe1 AS PAGEFRAME WITH ;
    		PAGECOUNT = 3, ;
    		page1.CAPTION = "Page1", ;
    		Page2.CAPTION = "Page2"
    
    	PROCEDURE pageframe1.page1.CLICK
    		WAIT WINDOW "Page 1" 
    	ENDPROC
    
    	PROCEDURE pageframe1.Page2.CLICK
    		WAIT WINDOW "Page 2" 
    	ENDPROC
    
    	PROCEDURE pageframe1.page3.CLICK
    		WAIT WINDOW "Page 3" 
    	ENDPROC
    
    	PROCEDURE CLICK
    		WAIT WINDOW "Form Click" NOWAIT
    	ENDPROC
    
    ENDDEFINE
    					
  2. Run the program.
  3. Click from tab to tab.

    In Visual FoxPro 6.0, occasionally the form's Click event fires even though you click on the pages of the pageframe. In Visual FoxPro 5.0a, the form's Click event seems to fire much more often.

    In Visual FoxPro 5.0, if the pageframe resides in a container object, then you see similar behavior: the Click event of the container object fires. This particular behavior does not seem to occur as often when running a form with that configuration in Visual FoxPro 6.0.

APPLIES TO
  • Microsoft Visual FoxPro 5.0 Standard Edition
  • Microsoft Visual FoxPro 5.0a
  • Microsoft Visual FoxPro 6.0 Professional Edition
Keywords: 
kbbug kbcontainer kbctrl kbfix kboop kbvs600sp3fix KB221613
 

Article Translations