BUG: Focus Changes Even Though Grid Text Box Valid Returns .F. (191686)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 3.0
  • Microsoft Visual FoxPro for Windows 3.0b
  • 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 Q191686

SYMPTOMS

In a grid, focus leaves the text box control to go to the control you are clicking even though the Valid method of the text box returns .F. or 0. However, the focus remains unchanged in the text box control when you are tabbing out to move to a different control.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new form, named mytest.
  2. Add a one column grid to the form and two Command buttons.
  3. In the Load event of the form, insert the following code:
          SET SAFETY OFF
          CREATE TABLE xyz (name C(10))
          INSERT INTO xyz VALUES ("test")
    							
  4. In the Valid method of the text box in the grid, place the following code:
          RETURN .F.
    							
  5. Save and run the form.
After you open the form, click Command button 1. The "Invalid input" message appears and then the focus shifts from the text box in the grid to the Command button. At the same time, the grid's text box also has a black border indicating that it also has focus. At this point, if you press the Tab key, the focus moves to the other command button. Apparently, the focus is no longer with the text box even though the Valid method in the text box is returning false.

Modification Type:MajorLast Reviewed:5/12/2003
Keywords:kbbug kbnofix KB191686