Re: scrolling a textbox
- From: "Lance" <chuckyboy81070-at-onehotpotatoimeanhotmail.com>
- Date: Mon, 16 May 2005 14:04:08 -0500
hi rick,
the string being loaded into the texbox shows the contents of a fixed-length
file that is updated every 6 minutes. the first 476 lines show the previous
476 readings from a tidal gage, the 477th line shows the most recent, and
the last 244 lines show predicted tidal levels forcasted out 1464 minutes
(244 readings * 6 minutes) from the most recent. so, when the data is
updated, one reading dissapears from the front and one appears at the end.
the way the gage works, the file is essentially completely knew from
begining to end, not just appeneded. that's why i'm loading the entire
string in to the textbox.
lance
"Rick Rothstein" <rickNOSPAMnews@xxxxxxxxxxxxxxxxx> wrote in message
news:eaOKSdkWFHA.3840@xxxxxxxxxxxxxxxxxxxxxxx
>> it's to make it negative in order to scroll downward from the top
> (which is
>> where it's positioned when the textbox is filled\refilled with
> "Text1.Text =
>> strDataFile")
>
> Not sure how this will affect Peter's suggestion (no time to try it out
> myself right now); however, you consider using SelText to place your new
> text into the TextBox (works like an append operation) rather than
> assigning the whole combined text to the TextBox... it is much more
> efficient to use SelText. Let's say the new text is stored in a String
> variable named NewText. Currently, you are doing the equivalent of
> this....
>
> strDataFile = Text1.Text & NewText & vbLfCr
> Text1.Text = strDataFile
>
> I'm suggesting to do it this way...
>
> Text1.SelStart = Len(Text1.Text)
> Text1.SelText = NewText & vbLfCr
>
> (I'm only guessing about when the newline character sequence is applied;
> adjust accordingly.) After doing the text addition in this way, the
> caret (text cursor) will be positioned at the end of the newly added
> text.
>
> Rick - MVP
>
.
- References:
- scrolling a textbox
- From: Lance
- Re: scrolling a textbox
- From: Peter Aitken
- Re: scrolling a textbox
- From: Lance
- Re: scrolling a textbox
- From: Rick Rothstein
- scrolling a textbox
- Prev by Date: Re: scrolling a textbox
- Next by Date: Re: Function Argument Problem
- Previous by thread: Re: scrolling a textbox
- Next by thread: Re: scrolling a textbox
- Index(es):
Relevant Pages
|