How to make scrollbar disappear after clearing textbox?

R

RB Smissaert

Have a textbox on a userform, which will show a vertical scrollbar when the
text exceeds the height of the textbox.
When I clear the textbox in code (Textbox1.Text = "") the scrollbar will
stay visible and only disappears when one of the arrows of the scrollbars is
clicked.
I have tried clearing the scrollbar by sending a mouseclick via API, but it
doesn't seem to work and there must be an
easier way to do this.
Thanks for any advice.

RBS
 
R

RB Smissaert

Figured this out:

With Textbox1
.SetFocus
.SelText = .Text
.Text = ""
End With

RBS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top