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

    Limiting number of line in text box

    Hi all,
    I'm looking for a solution for my textbox control
    I want the textbox as a output terminal to recive and display message, as so it continously recieve and display text. The problem is after
    inputing text for a while, the program force quit. There is a limitation in text (or number of charactor) can be show in teh text box. So I decided to
    build a "buffered" textbox - it can hold a number line of text. Eg: 20 line.It can always keep the last 20 line of message. When the 21th line is inputted, the 1st line will be discharge , the 2nd line
    will become the 1st line and so on. How can I do that?

    P.S. the textbox is setted to "multiline" and "vertical scroll bar". Text are inputted to textbox by "SelText"


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Limiting number of line in text box

    you could use the SendMessage API to send an EM_GETLINECOUNT message to the textbox.
    If it returns more than 20 lines, delete the first few lines...


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