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

Function to measure text length

P: n/a
I'm trying to create a function that will return the length of a text
string in inches.

e.Graphics.MeasureString(mString, mFont)

Seems to be what I'm looking for, but I don't know how to pass
PaintEventArgs (e).

I don't want to use it in a paint event, I just want it to return a
number when I pass it a string and a font. How do I do this?
Nov 11 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Never mind. I figured it out.

On Sat, 11 Nov 2006 02:09:51 GMT, Kevin <Ke****@nospam.cfl.rr.com>
wrote:
>I'm trying to create a function that will return the length of a text
string in inches.

e.Graphics.MeasureString(mString, mFont)

Seems to be what I'm looking for, but I don't know how to pass
PaintEventArgs (e).

I don't want to use it in a paint event, I just want it to return a
number when I pass it a string and a font. How do I do this?
Nov 11 '06 #2

P: n/a
Kevin,

Will you as you have figured it out show what you did, people are searching
in this newsgroup, there is quite a few about what you have asked, but now
you are blocking them because there is a new item without an answer in that.

Thanks in advance,

Cor

"Kevin" <Ke****@nospam.cfl.rr.comschreef in bericht
news:q8********************************@4ax.com...
Never mind. I figured it out.

On Sat, 11 Nov 2006 02:09:51 GMT, Kevin <Ke****@nospam.cfl.rr.com>
wrote:
>>I'm trying to create a function that will return the length of a text
string in inches.

e.Graphics.MeasureString(mString, mFont)

Seems to be what I'm looking for, but I don't know how to pass
PaintEventArgs (e).

I don't want to use it in a paint event, I just want it to return a
number when I pass it a string and a font. How do I do this?

Nov 11 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.