PDA

View Full Version : String break in Textbox



cocoflop
18-05-2007, 16:35
Hello,

I have a large square textbox (multilined, %ES_MULTILINE), do you know how can I break the string contained in this text box into paragraphs?.

Perhaps there should be some escape characters I don't know how to use, like Java uses "\n" sequence. I tried also a more basic-style programming method like

textfield = "First line" +CHR$(13)+ "Second Line"

but this example I think it only works in a console window, in the textbox returns this character |.

ErosOlmi
18-05-2007, 16:45
Should be enough to add


%ES_WANTRETURN OR %ES_MULTILINE

to style

Maybe also a %ES_AUTOVSCROLL

See example in thinBasic\SampleScripts\UI\TextBox\TextBox.tBasic
Should give an idea

To add a new line just use $CRLF in your text like:


'...
MyString = "any text " & $CRLF & "this will be in new line"
'...
CONTROL SET TEXT MyDialogHandle, MyControlID, MyString


Eros

cocoflop
18-05-2007, 17:08
OK, Eros $CRLF do the trick.
Also special characters like \n I noticed that work only message boxes.

That's all.