T
teo
Hallo,
I'd like to retrieve the pixel length of a string.
------------------------
I decided to use MeasureString,
but I have a problem with the graphic "instance" of it.
I'm in a Sub
and
I have the "graphics" word underlined:
Private Sub CalculateTheWidth
Dim myFont As New Font("Arial", 10)
Dim stringsize as SizeF
stringsize = graphics.MeasureString("Hallo", myFont)
End Sub
Also (little Asp.net theory here)
I will be on a .aspx web Form and a text in a Label control
and
I'd like to use the 'CalculateTheWidth' sub there too
because on some browsers the autosizing property of Labels
is not available.
But it seems that the MeasureString method is not available on Asp.Net.
So this measuring task is more difficult.
How to solve this?
I'd like to retrieve the pixel length of a string.
------------------------
I decided to use MeasureString,
but I have a problem with the graphic "instance" of it.
I'm in a Sub
and
I have the "graphics" word underlined:
Private Sub CalculateTheWidth
Dim myFont As New Font("Arial", 10)
Dim stringsize as SizeF
stringsize = graphics.MeasureString("Hallo", myFont)
End Sub
Also (little Asp.net theory here)
I will be on a .aspx web Form and a text in a Label control
and
I'd like to use the 'CalculateTheWidth' sub there too
because on some browsers the autosizing property of Labels
is not available.
But it seems that the MeasureString method is not available on Asp.Net.
So this measuring task is more difficult.
How to solve this?