Microsoft KB Archive/231938

= BUG: ResetToDefault Doesn't Work on Events and Methods in VFP 6.0 =

Article ID: 231938

Article Last Modified on 10/15/2002

-

APPLIES TO


 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q231938



SYMPTOMS
When calling the ResetToDefault method at run-time in Visual FoxPro 6.0, the following error occurs:

Property does not have a default value.

This error only occurs when resetting events or methods. Resetting properties does not produce the error.



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



MORE INFORMATION
When calling the ResetToDefault method, it resets the property, event, or method that it is referencing back to its default value. For example, issuing the following code sets the FontBold property of the form back to the default value of False: Thisform.ResetToDefault("FontBold") In Visual FoxPro 6.0, setting properties back to their default works correctly but setting events and methods back to their defaults causes the error described above. Of course, properties that are not available at run-time or design-time will always return the error, as they should.

Steps to Reproduce Behavior
  Copy the code into a program file: PUBLIC oform1 oform1=NEWOBJECT("form1") oform1.Show

DEFINE CLASS form1 AS form Caption = "Form1" Name = "Form1"

ADD OBJECT command1 AS commandbutton WITH ; Top = 120, ; Left = 184, ; Height = 27, ; Width = 99, ; Caption = "ResetToDefault", ; Name = "Command1"

PROCEDURE Click WAIT WINDOW "In the Form Click event." ENDPROC

PROCEDURE command1.Click Thisform.ResetToDefault("Click") ENDPROC ENDDEFINE  Run the program and click the command button. The error above occurs and the form's Click event is not set back to its default because the WAIT WINDOW command still fires.

Keywords: kberrmsg kbbug kboop kbcontainer kbctrl kbpending KB231938

-

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

© Microsoft Corporation. All rights reserved.