New line with Area Text Object
BlitzPlus Forums/BlitzPlus Programming/New line with Area Text Object
I did a loop to fill an area text by a list of several names:
SetGadgetText(area,TextAreaText(area)+Name$(i))
Problem is that all the names are "attached", I'd like one name by line, so I added:
SetGadgetText(area,TextAreaText(area)+$0D+$0A)
It doesn't work because $0D and $0A are considered like characters... Without using a List Object what's the solution?
use Chr(10)
I'm going to try! Thanks ;)
yep, Chr(10) works!
An now, how to make the area field not editable ? Disable the gadget disables the scrollbar bars too, so that's not right.
;.lib "user32.dll"
;SendMessage%(hWnd%,Msg%,wParam%,lParam%):"SendMessageA"
;Constant related to text area functionality
Const EM_SETREADONLY = $CF
SendMessage QueryObject(YourTextArea, 1), EM_SETREADONLY, True, 0
depending apon how large it is u can reapply the textarea text every loop. the lib'll be less consuming though..
It works, thanks! Except for Const EM_SETREADONLY = $CF, it generates an error, so I directly use $CF when I call the function.
I'm quite desappointed that Blitz doesn't include a such important function!
I guess there's also a specific function to limit the number of characters in a field?? As I don't know I do like that:
field$=TextFieldText(hdl_field)
If Len(field$)>SIZE_FIELD
SetGadgetText(hdl_field,Left(field$,SIZE_FIELD))
EndIf
I don't think there is a specific function built in, but that will do it for you.
Except for Const EM_SETREADONLY = $CF, it generates an error
It shouldn't. Are you sure you placed the constant declaration OUTSIDE of any functions?
Actually, I thought it was possible to declare a constant in the decls file and then use it in Blitz.