
forcing multiline textbox to scroll to last line...
that would have been the obvious solution, wouldn't
it?!? i feel like an idiot now! i guess we all need a
complete stranger to point out the obvious sometimes!
thanks much!
ben
Quote:
>-----Original Message-----
>This works for me:
>TextBox1.SelectionStart = TextBox1.Text.Length
>TextBox1.ScrollToCaret()
>> here's the problem:
>> i'm running a command-line executable as a managed
>> process from code in a utility i'm developing, and i'm
>> redirecting the standard output from this executable
to a
>> multiline textbox on the form. since this utility has
to
>> do with file compression, i'm listing all the files
added
>> to the archive and the percent complete in this
textbox.
>> do to the nature of the utility, it can take some time
to
>> complete this process, and hundreds of lines of output
>> may be generated. i'm adding each line of output that
is
>> applicable by altering the .Lines array. the problem
is,
>> as i add these new lines to the textbox, it doesn't
>> automatically scroll to the last line, and so the user
>> isn't able to see the most recent files or percent of
>> completion until the process has ended. IS THERE ANY
WAY
>> TO FORCE THE TEXTBOX TO SCROLL TO THE LAST LINE IN THE
>> LINES ARRAY? the only method i've found that even
>> remotely applies is the .ScrollToCaret method, which
>> won't work unless i can find a way to move the caret to
>> the last line of the textbox before invoking the
>> method...i've tried using the SendKeys.Send("{DOWN}")
>> method, but that won't work either. i'm kinda stuck
>> here. does ANYONE know how to do this??? thanks!
>.