title: Why is the RichTextBox's Font.Size property editable at design-time, but readonly at compile time?
body: <p>This code:</p>
  
  <pre><code>private void comboBoxFontSize_SelectedIndexChanged(object sender, EventArgs e) {
      rtbResults.Font.Size = Convert.ToInt32(comboBoxFontSize.SelectedItem);
  }
  </code></pre>
  
  <p>...generates this err msg: <em>"Property or indexer 'System.Drawing.Font.Size' cannot be assigned to -- it is read only"</em></p>
  
  <h2>UPDATE</h2>
  
  <p>After attempting the suggested fix, I get this at runtime:</p>
  
  <p>System.FormatException was unhandled
    Message=Input string was not in a correct format.
    Source=mscorlib
    StackTrace:
         at System.Number.StringToNumber(String str, 
  ...</p>
  
  <p>Okay, I see: I was using Convert.ToInt32() but the first value in the comboBox was "8.25" -which is, obviously, not an int.</p>
  
  <p>So I tried Convert.ToDouble() and that won't compile.</p>
  
  <p>Then I see in the intellisense hints that <em>"Calling this method</em> always throws 'System.InvalidCastException'"*</p>
  
  <ul>
  <li>as well as Convert.ToSingle()</li>
  </ul>
  
  <p>So must I change my combobox value from 8.25 to 8? 8.25 is the default value...???</p>
  
  <h2>UPDATED AGAIN</h2>
  
  <p>I read over the weekend (in Petzold's WP7 book, I think) that 8.25 corresponds to 11. So the 8.25 referred to here is, I think, pixels, which corresponds to font size of 11, which makes a lot more sense now (although still rather overly misleading/confusing).</p>