Autosize TextBox Height

V

V-Man

Is it possible to have a textbox width fixed and have it´s height autosized?

I want the textbox height to change dynamicly at runtime. The number of
lines (height) in the textbox would be determined by the amount of content,
while the textbox length would remain constant. I´ve tried all kinds of
solutions, but nothing seems to work for me.

Thanks!
 
S

sebastienm

Hi,
Have you tried tried to use a textbox from the Control Toolbox toolbar with
the following properties:
-Autosize=True
-EnterKeyBehavior=True
-Multiline=True

Regards,
Sebastien
 
V

V-Man

Thanks Frank, Sebastienm:

I set MultiLine = True and wrote this VBA code -

If TextBox3.TextLength > 60 Then TextBox3.AutoSize = True Else
TextBox3.AutoSize = False

This keeps the horizontal length constant while adjusted the height
according to the amount of data.

Thanks!
 

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