width of a text (font specific)
C#
3
Posts
3
Posters
0
Views
1
Watching
-
hello, how can i get the (display)width of a text in any font. i want to develop something like autosize of the label
You have to use a great function provided by the Graphic class named: MeasureString. I use that to write text in my chart webcomponent... check this article: http://www.codeproject.com/cs/media/measurestring.asp La Richesse & la Gloire ne griseront jamais que les temples
-
hello, how can i get the (display)width of a text in any font. i want to develop something like autosize of the label
the
Graphics
object has a method to measure text - it is not 100% accurate, but is pretty good. If im not mistaken their are windows API calls for the same purpose - some knowledgable person will no doubt be along to point them out!