Autosize TextBox Height

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
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
 
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!
 
Back
Top