Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sizing

Status
Not open for further replies.

eveCalypso

Programmer
Apr 29, 2003
134
GB
Hello All,

This is actually a follow-up with a twist from an earlier post. I mentioned that when I create a VBA form on the fly, Autosize yields unexpected results - and does not autosize correctly at all.
I need to ascertain the width needed for my text however (for a checkbox),
is there a good way of determining the width required from the length of the string contained in the checkbox??
Please please let me know if you have any ideas.

At the moment, I something like (not quite of course ;-)) :
chkBox1.width = Len(trim(givenString)) * aConstAdjustment + checkboxWidthAdjustment

Regards,
EvE
 
Sorry to be a pain,
but I can find very little on TextWidth in my VBA helpfile (in fact, next to nothing).
It sounds exactly like what I need.
Can you give me a tip or two on how its accessed please?

Best Regards,
EvE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top