M
microsoft
I want to resize the width of a picture box based on the length of a string.
I have a string "s".
I do this in the paint event of a picturebox:
Dim font As New Font("Arial", 12, FontStyle.Regular)
Dim sSize as SizeF = e.graphics.measurestring(s, font)
'Here's what i want to do that doesn't work
If PictureBox1.width < sSize then
PictureBox1.width = sSize
End if
---- I get the error "< operator is not defined for System.Drawing.Size
I have a string "s".
I do this in the paint event of a picturebox:
Dim font As New Font("Arial", 12, FontStyle.Regular)
Dim sSize as SizeF = e.graphics.measurestring(s, font)
'Here's what i want to do that doesn't work
If PictureBox1.width < sSize then
PictureBox1.width = sSize
End if
---- I get the error "< operator is not defined for System.Drawing.Size