By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,099 Members | 1,364 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,099 IT Pros & Developers. It's quick & easy.

How wide is a string?

P: 9
Is there any way to measure the width of a string of text in pixels? I know how many characters there are in the string, but i's and w's are different widths and the problem gets worse when you add in factors like italic or bold and as for different fonts... Basically what I want is a command that when suplied a text string and font name, etc. it returns the screen width in pixels.

Any method that works in VB6 would be appreciated. I'm mostly interested in on screen widths, but it would be a bonus if it works for on print as well.

Thanks in advance!
Mar 21 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.