Relative Content

Tag Archive for .netvb.netwinformsdot

VB Dot Net win forms multiline label largest possible font size

I have forms with fixed sized labels that will have variable length text values set to them and I want to be able to calculate the maximum font size possible to make the text fill the label control without loosing any characters. (Note I do NOT want to resize the label to fit the text)
The labels have their AutoSize and UseMnemonic properties set to False and the text must be allowed to flow onto multiple lines as to fill the width and height of the control as much as possible.
So a typical label size could be 700 wide by 300 high and the output should look something like this: