auto scroll in text box

  • Thread starter Thread starter Sean
  • Start date Start date
S

Sean

Hello All,

I've got a form in my application that contains a big text
box. I use it to display informational messages to my
users. The textbox is set up for vertical scrollbars. Is
there any way that I can programatically change what is
displayed? What I'm wanting to do is to auto scroll the
text box to the end after I add data to it. As it stands
now, when I add data the users have to scroll down to see
the additions.

Also, when I add text to the textbox, it is always
highlighted. Is there a way to have it display as normal
black on white un-highlighted text?

Thanks in advance.
Sean
 
See if this will do it.

Me.txtNameOfTextbox.SelStart = Len(Me.txtNameOfTextbox.Text)

This will move the cursor to the end of the text, hopefully, the box will
scroll as well. The control has to have the focus to be able to set the
SelStart position. If it doesn't, you'll have to set the focus to the
control first.

Me.txtNameOfTextbox.SetFocus
 
-----Original Message-----
See if this will do it.

Me.txtNameOfTextbox.SelStart = Len (Me.txtNameOfTextbox.Text)

This will move the cursor to the end of the text, hopefully, the box will
scroll as well. The control has to have the focus to be able to set the
SelStart position. If it doesn't, you'll have to set the focus to the
control first.

Me.txtNameOfTextbox.SetFocus

Wayne,

Thanks, that worked like a charm.

Sean
 
Back
Top