I\'d like to know if there\'s a better approach to this problem. I want to resize a label (vertically) to accomodate certain amount of text. My label has a fixed width (abou
How about Graphics.MeasureString, with the overload that accepts a string, the font, and the max width? This returns a SizeF, so you can round round-off the Height.
using(Graphics g = CreateGraphics()) {
SizeF size = g.MeasureString(text, lbl.Font, 495);
lbl.Height = (int) Math.Ceiling(size.Height);
lbl.Text = text;
}