FIX: Container Click Not Fired When Clicking Disabled Control (221723)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 6.0

This article was previously published under Q221723

SYMPTOMS

The Click event of a container or pageframe does not fire when clicking on a disabled control contained within the container or pageframe. The Click event of the form fires instead.

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. For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a form and place the following code in the Click event:
    WAIT WINDOW "Form Click"
  2. Add a container control to the form with the following in the control's Click event:
    WAIT WINDOW "Container Click"
  3. Add a command button to the container with the following in the button's Click event:
    WAIT WINDOW "Command button Click"
  4. Set the Enabled property of the command button to .F.
  5. Run the form and click the command button inside the container.
To see this behavior with a pageframe, follow these steps:
  1. Create a form and place the following in the Click event:
    WAIT WINDOW "Form Click"
  2. Add a pageframe control to the form. Select the control and place the following in the page1 Click event:
    WAIT WINDOW "Page1 Click"
  3. Add a command button to page1 with the following in the button's Click event:
    WAIT WINDOW "Command button Click"
  4. Set the Enabled property of the command button to .F.
  5. Run the form and click the command button on page one of the pageframe.

    Note that the form's Click event fires instead of the Click event of the container object when the disabled button is clicked. Similar behavior occurs with the pageframe. Instead of activating the page or pageframe's Click event, the form's Click event is called when the disabled button is clicked.

    The behavior is different in Visual FoxPro 3.0b and 5.0x. In these versions, the Click event of the container occurs when clicking the disabled button inside of it. In the case of a pageframe, the Click event of the page fires.

Modification Type:MajorLast Reviewed:10/15/2002
Keywords:kbBug kbContainer kbCtrl kbOOP kbVS600sp3fix KB221723 kbAudDeveloper