Getting size of a string (measurestring)
Ok, I know how to get the size in pixels of a string using measureString...
Here's my problem:
I need to resize text to fit inside the dimensions of my user control button.
I need to be able to have my user control automatically determine the appropriate font size based on how wide or high the control is.
This is what I got so far:
VB Code:
'get size of string to be printed
stringSize = graphics.MeasureString(text, Font)
'if size of string to be printed is larger than the width of the control
If stringSize > Width Then
'need to implement code that will
'set the font size to something that will
'fit within the Width of the control
'ie.. Font.Size = Width (which obviously isnt it, but makes it clear my intentions)