FIX: Clicking Page Tab Executes Container Click Event (221613)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a
  • Microsoft Visual FoxPro for Windows 6.0

This article was previously published under Q221613

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.

Modification Type:MajorLast Reviewed:10/16/2002
Keywords:kbBug kbContainer kbCtrl kbOOP kbVS600sp3fix KB221613