Hi,
Use the drawstring that accepts a string format.
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim sf As New StringFormat
Dim strOut As String = "Hello World"
With sf
..LineAlignment = StringAlignment.Center ' center vertically
..Alignment = StringAlignment.Center 'center horizontally
End With
e.Graphics.DrawString(strOut, Me.Font, Brushes.Black, _
RectangleF.op_Implicit(Me.ClientRectangle), sf)
End Sub
http://msdn.microsoft.com/library/de...ringtopic3.asp http://msdn.microsoft.com/library/de...nmenttopic.asp http://msdn.microsoft.com/library/de...nmenttopic.asp
Ken
--------------------
"Rlrcstr" <rl*****@msn.com> wrote in message
news:uX**************@TK2MSFTNGP12.phx.gbl...
Using Graphics.DrawString, is it possible to specify that the text is draw
centerd horizontally and/or vertically in the specified layout rectangle?
Thanks.
Jerry