CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2005
    Posts
    52

    Question Formatting a TextBox

    Hi guys,

    I am allowing users to fill a textbox with information, including carriage returns. Then I store this information into a memo field in an Access database.

    However, when I pull the information back out of the database, all the carriage returns have become "||"

    Does anyone have an idea on how to preserve the carriage returns or at least format the information properly for display?

    Thank you in advance.

  2. #2
    Join Date
    Dec 2002
    Location
    London, UK
    Posts
    1,569

    Re: Formatting a TextBox

    You need to make the text box "multiline" property true.

    If you want MORE formatting (i.e. font, size, bold, italics etc. etc.) to be preserved, then use the rich text box.
    Mike

  3. #3
    Join Date
    Mar 2005
    Location
    Vienna, Austria
    Posts
    4,538

    Re: Formatting a TextBox

    Quote Originally Posted by twistedfrog
    Hi guys,
    However, when I pull the information back out of the database, all the carriage returns have become "||"
    I'm sorry I never have had that problem also doing that in a lot of cases. When you display the memo again is it again in a textbox which is set to multiline = true ? I'm using MS Access 2000 and DAO since Windoes 95 up to XP now. In all that cases it works, so maybe this occurs in an other enviroment. If so, you can read out which characters that are in debugmode and then restoring them to vbCrLfusing Instr(...) and mid(...) function.

    Jonny Poet
    Jonny Poet

    To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
    Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
    If anyone felt he has got help, show it in rating the post.
    Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
    My latest articles :
    Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

  4. #4
    Join Date
    Oct 2005
    Posts
    52

    Re: Formatting a TextBox

    I had the multiline set to false - once again you guys are lifesavers! Thanks a bunch!

  5. #5
    Join Date
    Mar 2005
    Location
    Vienna, Austria
    Posts
    4,538

    Re: Formatting a TextBox

    Quote Originally Posted by twistedfrog
    I had the multiline set to false - once again you guys are lifesavers! Thanks a bunch!
    You are welcome
    Jonny Poet

    To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
    Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
    If anyone felt he has got help, show it in rating the post.
    Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
    My latest articles :
    Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

  6. #6
    Join Date
    Dec 2002
    Location
    London, UK
    Posts
    1,569

    Re: Formatting a TextBox

    cool. no prob
    Mike

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured