Hi,
Anyone having problems with line breaks in the TextBox control from the Compact Framework
I insert a string with line breaks, (yes the textbox is multi line enabled), save it to a database, read it back and all i get is little squares in place of these line breaks.
The funny thing is, this same exact data (no changes what so ever) is displayed correctly in a win forms application (running on the desktop).
I've tried the traditional methods and none of them seem to work, would re-installing the framework help
ps. This is what i am talking about: http://img134.imageshack.us/img134/7590/linebreaksample0ex.jpg
Could anyone please help me out
- Steve

Compact Framework Issues
Creature
- Steve
ERodrigues
- Steve
Federico Raggi - MSFT
How do I do this
boriss
dunnee
Right, so as you can see, the line breaks are for some reason 0A, 0A (LF, LF), but should be 0D, 0A (CR LF). Ideally you'd need to track down where and how it happens. As a quick fix, before assigning the string to the Text property, modify it like this:
C#:
myTextbox.Text = myString.Replace("\n", "\r\n");
VB:
myTextbox.Text = myString.Replace(vbLF, vbCrLf)
R Thompson
As a starting point could you print and post the following (when you get those "boxes"):
BitConverter.ToString(Encoding.ASCII.GetBytes(yourTextbox.Text))
Or better yet, do this with a string that you get back from the database.
I'd like to see what exactly are those characters
web_monkey2k
OK, here it is:
---------------------------
---------------------------
74-65-73-74-69-6E-67-20-6D-6F-72-65-20-74-68-61-6E-20-6C-69-6E-65-73-0A-0A-6D-6F-72-65-20-6C-69-6E-65-73-0A-0A-6D-6F-72-65-20-6D-6F-72-65-20-6D-6F-72-65-0A-0A-6D-6F-72-65-20-6D-6F-72-65-0A-0A-65-76-65-6E-20-6D-6F-72-65-20-65-76-65-6E-20-6D-6F-72-65-0A-0A-69-6E-20-74-68-65-20-48-4F-4F-4F-4F-4F-4F-44-21
---------------------------
OK
---------------------------
jvictor
- Steve