Is there a simple way to use a textbox as a buffer that holds the last
N lines or characters for logging info? Thanks. -- Bud

Re: Using TextBox as a buffer by james

james
Wed Jun 02 12:27:46 CDT 2004

Of course you could but why? Why not simply store it in a string ?

JIM


<bud1chicago@yahoo.com> wrote in message
news:7a29d29d.0406020921.548564e5@posting.google.com...
> Is there a simple way to use a textbox as a buffer that holds the last
> N lines or characters for logging info? Thanks. -- Bud



Re: Using TextBox as a buffer by hirf-spam-me-here

hirf-spam-me-here
Wed Jun 02 12:51:38 CDT 2004

* bud1chicago@yahoo.com scripsit:
> Is there a simple way to use a textbox as a buffer that holds the last
> N lines or characters for logging info?

Yes, if you do buffer management yourself.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Re: Using TextBox as a buffer by wwbach

wwbach
Mon Jun 07 14:10:33 CDT 2004

"james" <nospam@hypercon.net> wrote in message news:<#t6SDbMSEHA.1388@TK2MSFTNGP09.phx.gbl>...
> Of course you could but why? Why not simply store it in a string ?
>
> JIM
>
>
> <bud1chicago@yahoo.com> wrote in message
> news:7a29d29d.0406020921.548564e5@posting.google.com...
> > Is there a simple way to use a textbox as a buffer that holds the last
> > N lines or characters for logging info? Thanks. -- Bud

I guess I may not have been clear. I have an application that runs
24x7. Periodically, I need to display a message to the user so I spit
it out to a textbox using the AppendText() method. The textbox
control is limited to 32K bytes of data, so what I'd like to do is
display the last 100 lines or so messages and every time I add a new
line, have the oldest message fall off the screen.

Is there a simple way to do this? I could keep a circular array of
strings in memory and refill the textbox from this array every time I
get a new message to display but I would think this would be very
inefficient and would probably cause a lot of flickering on the
display. There must be a better way that I haven't thought of.
Probably something obvious... -- Bud

Re: Using TextBox as a buffer by Jon

Jon
Mon Jun 07 14:15:22 CDT 2004

Bud Bach <wwbach@ameritech.net> wrote:

<snip>

> Is there a simple way to do this? I could keep a circular array of
> strings in memory and refill the textbox from this array every time I
> get a new message to display but I would think this would be very
> inefficient and would probably cause a lot of flickering on the
> display. There must be a better way that I haven't thought of.
> Probably something obvious... -- Bud

Rather than keeping the strings themselves and repopulating the
textbox, just keep the *lengths* of the strings, and you can work out
how much to chop off the start each time you want to update it.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Re: Using TextBox as a buffer by Jonathan

Jonathan
Tue Jun 08 07:56:56 CDT 2004

Why not use a listbox instead? It is easier for you to keep track how
many lines have been added. And probably you can avoid the overhead of
manipulating string.



Bud Bach wrote:
> "james" <nospam@hypercon.net> wrote in message news:<#t6SDbMSEHA.1388@TK2MSFTNGP09.phx.gbl>...
>
>>Of course you could but why? Why not simply store it in a string ?
>>
>>JIM
>>
>>
>><bud1chicago@yahoo.com> wrote in message
>>news:7a29d29d.0406020921.548564e5@posting.google.com...
>>
>>>Is there a simple way to use a textbox as a buffer that holds the last
>>>N lines or characters for logging info? Thanks. -- Bud
>
>
> I guess I may not have been clear. I have an application that runs
> 24x7. Periodically, I need to display a message to the user so I spit
> it out to a textbox using the AppendText() method. The textbox
> control is limited to 32K bytes of data, so what I'd like to do is
> display the last 100 lines or so messages and every time I add a new
> line, have the oldest message fall off the screen.
>
> Is there a simple way to do this? I could keep a circular array of
> strings in memory and refill the textbox from this array every time I
> get a new message to display but I would think this would be very
> inefficient and would probably cause a lot of flickering on the
> display. There must be a better way that I haven't thought of.
> Probably something obvious... -- Bud