I'm drawing text to a control in the OnPaint event. It works fine except that it is trimming the string. I need the string to be a certain length.
Any ideas?
-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
Code:
Dim rect As New System.Drawing.RectangleF(Me.ClientRectangle.X, Me.ClientRectangle.Y, Me.ClientRectangle.Width, Me.ClientRectangle.Height)
Dim strFmt As New System.Drawing.StringFormat
strFmt.LineAlignment = Drawing.StringAlignment.Near 'Far = Top, Near = Bottom
strFmt.Alignment = Drawing.StringAlignment.Center
strFmt.Trimming = Drawing.StringTrimming.None
sender.DrawString(text.PadLeft(9), Me.Font, New System.Drawing.SolidBrush(Me.FontColor), rect, strFmt)
-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!