Microsoft KB Archive/138376

= BUG: NODEFAULT Is Ignored in Text Box KeyPress Event Code =

Article ID: 138376

Article Last Modified on 5/7/2003

-

APPLIES TO


 * 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 Q138376



SYMPTOMS
The NODEFAULT clause is ignored in the KeyPress event of a text box custom class based on the text box base class.



WORKAROUND
To work around this, perform the following:


 * 1) Edit the form.
 * 2) Click the text box on the form.
 * 3) Right-click the KeyPress event in the property sheet, and then click Reset to Default.



STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Problem
 Create a form, and place a text box on the form. In the KeyPress event of the text box, enter the word, NODEFAULT. Save the text box as a class. Delete the text box from your form. Place an instance of the text box class on your form. You can do this by adding the class library that contains the text box to the Form Control toolbar. Next, drop the text box control onto the form. Run the form and note that you are unable to type in the form. This is the expected behavior.</li> Edit your form, and add the following line to the KeyPress event of the instance of the text box:

TEXTBOX::KEYPRESS

</li> Run your form. Note that you can now type into it, but each letter you type is doubled. This is the expected behavior.</li> Edit your form, and from the KeyPress event of your text box, delete the code you entered in step 7 (the line TEXTBOX::KEYPRESS).</li> Run your form. Note that now you can type into it even though you removed the code you added and returned it to its original status where you couldn't type into it.</li></ol>

Additional query words: kbvfp300 kbvfp500 kbvfp600

Keywords: kbbug kbprogramming KB138376

-

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

© Microsoft Corporation. All rights reserved.