Getting the Width of a Text in Web

J

Jerry

Getting the Width of a Text in Web

Like this:

dim x as integer

len = GetTheLength("MyBlaBla")


I try to do it this way with a Label but after a view thimes runnig the
thing it Crashes
by saying the Class allready exists...



Dim graph As System.Drawing.Graphics
Dim font As System.Drawing.Font
Dim label As New Windows.Forms.Label
Dim rect As New System.Drawing.SizeF

font = New System.Drawing.Font("verdana", 8)
graph = label.CreateGraphics <<<<<<<< There it crashes some times
(not evry time)
rect = graph.MeasureString("Bla", font)
graph.Dispose()
label.Dispose()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,781
Messages
2,569,615
Members
45,293
Latest member
Hue Tran

Latest Threads

Top