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

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

    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,868
    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,793
    try '\r\n' or maybe '\n\r'

  4. #4
    The Earth is not flat. Clyde's Avatar
    Join Date
    Mar 2002
    Posts
    1,403
    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, 08: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, 09: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, 02:33 PM
  5. Placing Text in An Edit box
    By CodeMonkey in forum Windows Programming
    Replies: 13
    Last Post: 11-25-2001, 08:13 PM