ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   TRYING FIGURE out how wide a text box should be in userform (https://www.excelbanter.com/excel-programming/431951-trying-figure-out-how-wide-text-box-should-userform.html)

Bruce[_2_]

TRYING FIGURE out how wide a text box should be in userform
 
I am trying to create a form programically.

I have different varying lenth of fields. I am sure there has to be a way to
calculate the width of the field, based on the font size and the number of
characters. Any ideas how to figure the width?

Thanks
Bruce


Rick Rothstein

TRYING FIGURE out how wide a text box should be in userform
 
Did you want the width of the TextBox to vary with the user's entry? If so,
set the AutoSize property to True.

--
Rick (MVP - Excel)


"Bruce" wrote in message
...
I am trying to create a form programically.

I have different varying lenth of fields. I am sure there has to be a way
to
calculate the width of the field, based on the font size and the number of
characters. Any ideas how to figure the width?

Thanks
Bruce



Bruce[_2_]

TRYING FIGURE out how wide a text box should be in userform
 
They are to be fixed width. I need to figure out the width so that I can
programically build a set of forms. What I want to do is to have all of the
definition in a spreadsheet, and for columnA in the form, the eidth would be
in starting (left) would be at x position. I know what the length in chars
each cell should be. I figure I should be able to calculate for the next
column on the form , knowing the starting position, the length of the field
and then the FONT SIZE. I would have thought it would be pretty forward, in
the following fasion nextrow pos = left +(FONT.SIZE*CHARLEN)+ pad
But it does not seem to be very accurate

Thanks
Bruce

"Rick Rothstein" wrote in message
...
Did you want the width of the TextBox to vary with the user's entry? If
so, set the AutoSize property to True.

--
Rick (MVP - Excel)


"Bruce" wrote in message
...
I am trying to create a form programically.

I have different varying lenth of fields. I am sure there has to be a way
to
calculate the width of the field, based on the font size and the number
of
characters. Any ideas how to figure the width?

Thanks
Bruce





All times are GMT +1. The time now is 12:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com