Click to See Complete Forum and Search --> : Limiting number of line in text box


Sodium
October 25th, 1999, 10:19 AM
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"

Lothar Haensler
October 25th, 1999, 11:15 AM
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...