Compact Framework Issues

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




Answer this question

Compact Framework Issues

  • Creature

    Ok, ill let you know. One thing you have to note though is that the line breaks appear perfectly fine in a label, just not in the textbox. So i think ths "bug", if that is what it is, is at the control level.

    - Steve

  • ERodrigues

    Thank you so much!

    - Steve

  • Federico Raggi - MSFT

    AlexFeinman wrote:
    Make sure that each line is terminated with CRLF and not just LF ("\r\n" in C#, vbCrLf in VB.NET)


    How do I do this

  • boriss

    Make sure that each line is terminated with CRLF and not just LF ("\r\n" in C#, vbCrLf in VB.NET)

  • 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

    Ok, ill let you know. One thing you have to note though is that the line breaks appear perfectly fine in a label, just not in the textbox. So i think ths bug, if that is what it is, is at the control level.

    - Steve

  • Compact Framework Issues