* "Cliff Lane" <C_*******@email.msn.com> scripsit:
I am just getting into the area of printing and I am trying to determine the
maximum drawing width that a text field of 25 characters will take up so I
can right align the next field. Is there something comparable to the
textwidth method of vb 6 that will give me this information?
'Graphics.MeasureString':
<URL:http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemdrawinggraphicsclassmeasurestringtopic. asp>
\\\
Dim g As Graphics = Label1.CreateGraphics()
Dim s As SizeF = _
g.MeasureString(Label1.Text, Label1.Font, Label1.Width, StringFormat.GenericTypographic)
g.Dispose()
///
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>