Freddo
2010-03-05 14:52:38 UTC
Hi All,
In the Form_Load event, I'm running the following code after populating a
TextBox from a file. The TextBox's MultiLine property is enabled and I have
a vertical scrollbar on this control. This code DOES work if outside of the
Form_Load event if when it's executed "after" the form is loaded.
My question is this: Is there a Form event I can use or am I missing
something regarding an event in the the control itself I should use? Here's
the code:
' Set the cursor to the end of the textbox.
txtScroll.SelectionStart = txtScroll.TextLength
txtScroll.ScrollToCaret() ' Scroll down to the cursor position.
In the Form_Load event, I'm running the following code after populating a
TextBox from a file. The TextBox's MultiLine property is enabled and I have
a vertical scrollbar on this control. This code DOES work if outside of the
Form_Load event if when it's executed "after" the form is loaded.
My question is this: Is there a Form event I can use or am I missing
something regarding an event in the the control itself I should use? Here's
the code:
' Set the cursor to the end of the textbox.
txtScroll.SelectionStart = txtScroll.TextLength
txtScroll.ScrollToCaret() ' Scroll down to the cursor position.
--
Thanks in advance for your help -- it is greatly appreciated!
Kind regards - Fred
Thanks in advance for your help -- it is greatly appreciated!
Kind regards - Fred