Published on August 5, 2006 By Skarny In DesktopX
When I add text to a multi line text box control I can use Enter and add carriage returns to the text in the control.

I then save the text out to a string variable.

If I then set Control.Text to that string, the carriage returns are represented by their control code boxes, instead of actual carriage returns.

Is there a way to reload a string with carriage returns in it back into a DX textbox control and have the control show the carriage returns instead of boxes?

Comments
on Aug 06, 2006
Hmm... that sounds like a bug to me. In the meanwhile until it's fixed you could do a search and replace for it.
on Aug 08, 2006
Yes. I've done this let me look. Hmm. Ahh! Here's the script:

If DesktopX.Object("EditControlBack").Visible Then
DesktopX.Object("PadText").Text = DesktopX.ScriptObject("TextEditor").Control.Text
Else
DesktopX.ScriptObject("TextEditor").Control.Text = DesktopX.Object("PadText").Text
End If

This script is in a toggle button that activates DesktopX.Object("EditControlBack") which is a parent container object for my ActiveX DX Edit control(this makes the ActiveX Edit control just like a regular DX object that has a visible property!). Basically it does the following: If the user wants to use the Text Editor the Text to edit is placed in the DX Edit control in the else statement otherwise the user is closing the Text Editor and the modifieded text is placed in the text container object. Please note that the text is passed to an ordinary DX text object that acts as a container and is displayed. There are no control code problems and no need to scan the text in a string variable or anything. DX does all the work. Hope that helps.