Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27353

ScrollToCaret not working

$
0
0
Quick one (hopefully) chaps,

One of my forms has a multiline textbox which is a dead simple log of whats been going on in my app.
It can get quite lengthy with various API calls and their subsequent responses going on so i'd like it to autoscroll to the bottom.

I googled around and straight away found that i need to do this with ScrollToCaret(), but once implemented it doesnt make any difference.

Am i doing something wrong?

Heres an example of one of the places I have implemented it:

Code:

txtlog.Text = txtlog.Text & ControlChars.NewLine  _
                & Now() & " - " & api_call_result _
txtlog.ScrollToCaret()

It doesnt give any errors or anything, just every time the textbox refreshes, it stays firmly at the top.

I also just tried adding

Code:

txtlog.ScrollToCaret()
at the bottom of my tick sub so that would be the last thing it did on each tick, but that didnt work either.
Its not a massive problem, just an annoyance more than anything.

thanks!!

Jonny

Viewing all articles
Browse latest Browse all 27353

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>