this is in VB.NET
Dim W As Single
Dim cFont as New Font("Times New Roman",12,FontStyle.Regular)
v.FormatFlags = v.FormatFlags Or StringFormatFlags.MeasureTrailingSpaces
W = owner.CreateGraphics.MeasureString(X(I), cFont, owner.Width, v).Width
I've tried
dest.X += Math.Round(W)
and
dest.X += W
and
dest.X += Convert.ToInt32(W)
The X coordinate seems to end up anywhere from 4 to 20 pixels away from the actual end of the string on screen.