0
The following code works with winforms
:
while (label1.Width < System.Windows.Forms.TextRenderer.MeasureText(label1.Text,
new Font(label1.Font.FontFamily, label1.Font.Size, label1.Font.Style)).Width)
{
label1.Font = new Font(label1.Font.FontFamily, label1.Font.Size - 0.5f, label1.Font.Style);
}
How can I do this in WPF ? The idea is to make a autoresize
in a textbox
until every word fits.
Follow the image below, which in the last line was cut, I want to decrease the font size until show all words.
The photo above is not a label
, is a textbox
.
Any idea to do in WPF ?