Re: scrolling a textbox

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
>


.



Relevant Pages

  • Re: ListBox question
    ... other than a String, the compiler would complain. ... Dim myArray As Variant ... Dim myLong As Long ... I tested by entering a 'plain textbox shape' ...
    (microsoft.public.word.vba.general)
  • Re: ListBox question
    ... "Russ" wrote: ... other than a String, the compiler would complain. ... Dim myLong As Long ... I tested by entering a 'plain textbox shape' ...
    (microsoft.public.word.vba.general)
  • Re: Textbox Validation and Associated Checkbox
    ... Notice I have added the test for an empty TextBox (the empty string is not a number which is why you were caught up in a loop). ... Private Sub TextBox1_MouseDown(ByVal Button As Integer, ... DecimalPointSymbol = Format$ ...
    (microsoft.public.excel.programming)
  • Re: Spell Checker
    ... I have a textbox, that he user can type some information. ... Private m_sTextCorrected As String ... Public Property Get TextCorrectedAs String ... you must add a reference to the Word object library. ...
    (microsoft.public.vb.controls)
  • Re: Numeric Textbox Code
    ... This textbox checks the entered text upon the user leaving the textbox, ... Public Sub New ... 'This call is required by the Windows Form Designer. ... ' String representation of the RegEx that will be used to ...
    (microsoft.public.dotnet.languages.vb)