Thread: Multi line

  1. #1
    Registered User
    Join Date
    Jul 2005
    Posts
    13

    Multi line

    Hello, how can I write in a text box in different lines?
    I explain myself, I use Borland and I want to write something in a line, for example "ABC", and in the second line "DEF". I try this, but it is written all in the same line.
    Code:
    Edit3->Text="ABC\n DEF"
    Thanks,

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    Did you create edit box with ES_MULTILINE style?
    Also change the \n to \r\n
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #3
    Registered User
    Join Date
    Jul 2005
    Posts
    13
    How can I do that?

  4. #4
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    Post your edit box creation code.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  5. #5
    Registered User
    Join Date
    Jul 2005
    Posts
    13
    Code:
      object Edit3: TEdit
        Left = 152
        Top = 16
        Width = 193
        Height = 161
        TabOrder = 3
        Text = 'Edit3'
      end

  6. #6
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    I can only show you how to do it in API not borlands library. Perhaps you had better wait for a borland afficionado.
    btw. this is really windows programming, we have a board for the purpose.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  7. #7
    Registered User
    Join Date
    Jul 2005
    Posts
    13
    Thanks anyway, I´ll see if any borland user can help me.

  8. #8
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Moved to windows board.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  9. #9
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    New York
    Posts
    1,905
    Quote Originally Posted by Stoned_Coder
    Also change the \n to \r\n
    I echo that if you haven't already done it, windows is picky about its newlines.

    Ok, I just did a bit of research and it appears what you're working with seems to be a combination of a couple of things. If you could tell us exactly what you're working with that would be awesome.
    Last edited by jverkoey; 08-09-2005 at 05:39 AM.

  10. #10
    Registered User
    Join Date
    Jul 2005
    Posts
    13
    I´ve tried with \r\n and it doesn´t work . I´m working in a windows program in wich you write some text, that text is saved into a file, and that file is send to a computer. I want that text box to show if the text has been correctly saved.

    I´m working with XP and Borland C++ Builder 6.

    Thanks,

  11. #11
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    You should check the Borland vcl documentation - isn't TEdit a single-line edit control wrapper anyway? If that's the case you'll probably have to use another control that supports multiline - TMemo, maybe?

    This is all guesswork as it's been a long time since I last fiddled around with borland builder. In the absence of someone more informed about bcb, check the documentation and look for a method/flag for the control(s) of interest that may enable multiline behaviour.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  12. #12
    Registered User
    Join Date
    Jul 2005
    Posts
    13
    Thanks, I found the problem. As Ken Fitlike said, TEdit only allows you to write in a single line. The control that allows you to write in a multiline is TMemo.

    Thanks for your help!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading a buffer line by line, while using system read
    By Hammad Saleem in forum C Programming
    Replies: 9
    Last Post: 05-27-2008, 05:41 AM
  2. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM
  3. SSCANF help
    By mattz in forum C Programming
    Replies: 7
    Last Post: 12-10-2001, 04:53 PM
  4. Validating the contents of a char buffer
    By mattz in forum C Programming
    Replies: 3
    Last Post: 12-09-2001, 06:21 PM