Text Size (Extent?)

  • Thread starter Thread starter Gary Brown
  • Start date Start date
G

Gary Brown

Hi,

MFC has functions that calculate the width and height of a
text string, GetTextExtent being one of them. Does .NET/C#
have an equivalent?

Or how does one do this in C#?

Thanks,
Gary
 
I can see that .net is going to be fun.
I need the length of a string so I start with SystemDrawing, but I'm not
drawing anything.

Then I use Graphics but to me a string is not graphics.

Then finally I MeasureString.

My concept of logic goes right out the window.

Galen S
 
Sorry, but i don't understand your complaint :). You wanted an equivalent of
the GetTextExtent function which computes the width and height of a line of
text using the current font. If you want just a length of a string just use
MyStringInstance.Length :)

Regards
 
Back
Top