Microsoft KB Archive/173782
Article ID: 173782
Article Last Modified on 5/10/2003
- Microsoft Visual FoxPro 3.0 Standard Edition
- Microsoft Visual FoxPro 3.0b Standard Edition
- 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 Q173782
In Visual FoxPro 3.x and 5.x, the MouseMove event fires when you move over a disabled control. This behavior may confuse some developers because the MouseMove event does not fire on a disabled control in Visual Basic 5.0 and Microsoft Access 97.
You must write code to determine the status of the Enabled property of the object and then conditionally perform the MouseMove event method code. The following code checks if the object's Enabled property is true and if so, permits your MouseMove method code to conditionally execute.
IF This.Enabled=.t. ThisForm.Command2.Visible=.f. ENDIF
This behavior is by design.
This is the desired behavior in Visual FoxPro. Since Visual FoxPro does not automatically disable the MouseMove event of a disabled object, it offers you more flexibility in application design. If you want to emulate the behavior found in Visual Basic or Microsoft Access 97, see the RESOLUTION section above.
Steps to Reproduce Behavior
- Create a form that contains two command buttons.
In Command1, set the Enabled property to false (.F.) and add the following code to the MouseMove event:
- Run the form and move the icon over the disabled command button. The MouseMove fires and the Command2 object becomes invisible.
Additional query words: MouseMove Access Visual Basic
Keywords: kbprb KB173782