How do i make a "new line" with in an edit box?

This is a discussion on How do i make a "new line" with in an edit box? within the Windows Programming forums, part of the Platform Specific Boards category; Ok I can print to my edit box with SetWindowText(), but how do I split the text into lines? \n ...

  1. #1
    The Earth is not flat. Clyde's Avatar
    Join Date
    Mar 2002
    Posts
    1,420

    How do i make a "new line" with in an edit box?

    Ok I can print to my edit box with SetWindowText(), but how do I split the text into lines? \n doesn't seem to work.

    There must be a way, because I can enter lines of text (including returns) scan it to a char array with GetWindowText() and the put it back into the edit box with SetWindowText().

    So what symbol is used to mean new line?

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    try giving the edit

    ES_AUTOVSCROLL | ES_MULTILINE//will allow ENTER == new line and scroll to show current line

    or use

    \r
    Last edited by novacain; 05-18-2002 at 12:19 PM.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    try '\r\n' or maybe '\n\r'

  4. #4
    The Earth is not flat. Clyde's Avatar
    Join Date
    Mar 2002
    Posts
    1,420
    Thanks guys, \r\n works

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Edit box question
    By learning110 in forum Windows Programming
    Replies: 6
    Last Post: 03-28-2003, 07:16 PM
  2. how to define the variable of a edit box?
    By Jasonymk in forum Windows Programming
    Replies: 2
    Last Post: 02-10-2003, 08:23 PM
  3. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM
  4. How do I make and edit box scroll down with code?
    By Unregistered in forum Windows Programming
    Replies: 0
    Last Post: 11-26-2001, 01:33 PM
  5. Placing Text in An Edit box
    By CodeMonkey in forum Windows Programming
    Replies: 13
    Last Post: 11-25-2001, 07:13 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21