On Aug 21, 2006, at 3:39 PM, Brian Heibert wrote:

Is it possible to take this caption of text
me.Caption = "Say It..."
and figure out how many characters the caption takes up?

Len(s) or s.Len() returns an integer with the number of characters that the string contains. Do *not* use LenB which will return the number of bytes and is not useful for your needs.

I tried the previous solution that worked for PushButtons but now I am using a custom button that looks better with Brushed Metal windows

You can only guesstimate the size of the string (in pixels) with Len (). Unless you use a monospaced font like Courier, different characters take different amounts of space... a caption of 10 m's "mmmmmmmmmm" is considerably longer (in pixels) than 10 dots/periods "..........". The "m" character is usually the longest character in the roman alphabet, and should be a good "worst-case" size for estimations.

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to