BUG: Referencing Value Property In InteractiveChange of Editbox

ID: Q217059


The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, versions 5.0, 5.0a, 6.0


SYMPTOMS

When typing new text within the existing text of an edit box control, the insertion point of the new letters jumps around when you type them in from the keyboard.


CAUSE

This behavior occurs when you reference the Value property of an edit box within the InteractiveChange event of the edit box and the text in the edit box contains carriage return/line feed characters.


RESOLUTION

Use the Text property instead of the Value property when referring to the contents of the edit box in the InteractiveChange event.


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. Copy the following code into a program file, save it and then run the program.

     
    
    PUBLIC oform1
    
    oform1=NEWOBJECT("form1")
    oform1.Show
    RETURN
    
    ******************************************
    *-- Form:         form1
    *-- ParentClass:  form 
    *-- BaseClass:    form
    *
    DEFINE CLASS form1 AS form
    
       Top = 0
       Left = 0
       DoCreate = .T.
       Caption = "Form1"
       Name = "FORM1"
    
       ADD OBJECT edit1 AS editbox WITH ;
          Height = 169, ;
          Left = 120, ;
          Top = 24, ;
          Width = 145, ;
          Name = "Edit1"
    
       PROCEDURE edit1.InteractiveChange
    
          *x=This.Text
          x=This.Value
    
       ENDPROC
    
    ENDDEFINE
    *
    *-- EndDefine: form1
    ************************************** 


  2. Type the following text into the edit box on the form. In the next step, "enter" represents presenting the enter key once.

    
    
       Hello      enter
    
       Line 2     enter
    
       Line 3     enter
    
       Line 4     enter
    
                  enter
    
                  enter
    
       Line 7     enter
    
       Line 8     enter 


  3. Using the mouse, click between the "e" and "2" on Line 2 to position the insertion point.


  4. Start typing and watch the letters end up throughout the existing text.


Additional query words: kbDSE kbcode

Keywords : kbContainer kbCtrl kbOOP kbVBp500bug kbVFp600bug
Version : WINDOWS:5.0,5.0a,6.0
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: March 12, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.