Forum Discussion

praveensqa's avatar
praveensqa
Contributor
13 years ago

Is there any method for appending the Previous Text.

Hi All,



"setText" is for overriding the Text. Is there any method for appending the Previous Text.

Regards,

Praveen

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Do it in a couple of steps.



    1)  Assign the value of the "text" property of the object to a variable

    2)  Concatenate your new text onto the old and reassign the result back to the variable

    3)  Use setText to set the value of the control to the value of the variable.
  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Hi Praveen,



    You can also use the Keys method to send the Ctrl+End shortcut to move the insertion point at the end of the text and then type the new text:

    textBox.Keys("^[End]new text")