This could be done very easy with the System.Windows.Forms.TextRenderer.MeassureString-method.
You give it your text and your font and it gives you a size.
Now you have to build a method, which compares (by trying) which maximum fontsize would match.
You have to increase or decrease the try-fontsize until the TextRenderer-Size matches best to your Control-Size.
Function GetFontSizeMatch(ByVal myText As String, ByVal myFont As Font, ByVal mySize As Size) As Single
If Trim(myText).Length <= 0 Then myText = "X"
Dim currentSize As Single = CSng(myFont.Size)
Dim workFont As Font = New Font(myFont.Name, currentSize, myFont.Style, myFont.Unit)
Dim Nutzbreite As Single = CSng(mySize.Width)
Dim Nutzhöhe As Single = CSng(mySize.Height)
Dim myTextSize As SizeF
If (Nutzbreite >= 1) AndAlso (Nutzhöhe >= 1) Then
Do
currentSize += 4.0 : If currentSize > 50 Then Exit Do
workFont = New Font(workFont.Name, currentSize, workFont.Style, workFont.Unit)
myTextSize = TextRenderer.MeasureText(myText, workFont)
Loop Until (myTextSize.Width > Nutzbreite) Or (myTextSize.Height > Nutzhöhe)
Do
currentSize -= 0.5 : If currentSize < 5 Then Exit Do
workFont = New Font(workFont.Name, currentSize, workFont.Style, workFont.Unit)
myTextSize = TextRenderer.MeasureText(myText, workFont)
Loop Until (myTextSize.Width <= Nutzbreite) AndAlso (myTextSize.Height <= Nutzhöhe)
End If
Return currentSize
End Function