How to resize a textbox and form

G

Guest

I have a listbox with a double click event that opens a form when a user
selects a entry. The form has a textbox that displays the full memo field
based on what the user selects. I would like to resize both the textbox and
form to just fit the text size (i.e. if the text is five lines then set the
form and textbox to just large enough for 5 lines, if it 25 lines then resize
to fit the 25 lines, etc..).

I have users with multiple screen resolutions so I would like for the code
to work with any resolution.

How can I best accomplish this in vba or is this possible?

Thanks in advance for any assitance!

Jerry
 
R

Rick Brandt

JWS315 said:
I have a listbox with a double click event that opens a form when a
user selects a entry. The form has a textbox that displays the full
memo field based on what the user selects. I would like to resize
both the textbox and form to just fit the text size (i.e. if the text
is five lines then set the form and textbox to just large enough for
5 lines, if it 25 lines then resize to fit the 25 lines, etc..).

I have users with multiple screen resolutions so I would like for the
code to work with any resolution.

How can I best accomplish this in vba or is this possible?

Thanks in advance for any assitance!

Jerry

See the link below for a solution that Stephen Lebans came up with.

http://www.lebans.com./autosize_textbox.htm
 

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