DrawString Centered Text in C#
<p>Today I am trying to draw a string on a form, but need to be drawn exactly in the middle, I have sought functions but I do not see the parameters of the rectangle centered or obtained automatically.</p>

<p>If someone would kindly give me some function in which to center the text automatically. The commands I use are:</p>

<pre><code> gfx.DrawString(line, printFont, myBrush, leftMargin, YPosition(), new StringFormat());
</code></pre>

<p>Thanks for your Help</p>
