Hi,
I have a function in the gui 'add-logs', which writes to a rich-textbox
It does the following:
$richtextboxMainfFormOutPutLogging.Text += $text
$richtextboxMainfFormOutPutLogging.ScrollToCaret()
It works fine but scrolls to the top whereas the lines (log) added are in the bottom of the richtextbox
How can I address this?
Please advise
Scrolltocarret
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Scrolltocarret
That's not the issue, I have already
$richtextLogging.SelectionStart = $richtextLogging.Text.Length
but the output is added at the bottom of the richtextbox whereas the focus is at the top of the richtextbox.
Not sure how I can do this with select()(?)
$richtextLogging.SelectionStart = $richtextLogging.Text.Length
but the output is added at the bottom of the richtextbox whereas the focus is at the top of the richtextbox.
Not sure how I can do this with select()(?)
Re: Scrolltocarret
That is not what I posted. You have to use "Select()" to set the caret. before you can scroll to it. "SelectionStart" is only used the user select with the mouse or keyboard.
See: https://docs.microsoft.com/en-us/dotnet ... stem_Int32_
See: https://docs.microsoft.com/en-us/dotnet ... stem_Int32_
Re: Scrolltocarret
Here is a sampler I found in my junk box. It demonstrates how to do many tings with text boxes and controls.
- Attachments
-
- Demo-RTFColors.psf
- (22.45 KiB) Downloaded 131 times