title: C# String Measurements
body: <p>I want to measure the length of a string into pixel units. I searched the web for 2 days but got no luck. Finally, I found some code snippet a few minutes ago from a blog and modified it a little bit. Here's my function:</p>
  
  <pre><code>private void cmdMeasure_Click(object sender, EventArgs e)
  {
      Font fntStyle = new Font("Arial", 16, FontStyle.Regular, GraphicsUnit.Pixel);
      Size textSize = TextRenderer.MeasureText(str2measure.Text, fntStyle);
      MessageBox.Show(textSize.ToString());
  }
  </code></pre>
  
  <p>Question:</p>
  
  <p>What is the unit of 16? Is it em, pt, or the unit of GraphicsUnit enum? I don't really get the description defined by c# "the em-size of the new font in the units specified by the unit parameter."</p>
  
  <p>Does the TextRenderer.MeasureText method include the spaces between the characters in its measurement?</p>