title: Changing font using a font dialog c#
body: <p>Can anyone tell me how I can change the font using a font dialog. I'm trying to get it so either the selected text changes or if no text is selected only the font after the marker gets changed (not the whole textbox).</p>
  
  <p>This is what I have so far. Thanx</p>
  
  <pre><code> private void menuFont_Click(object sender, EventArgs e)
      {
          if (fontDialog1.ShowDialog() == DialogResult.OK)
          {
              if (richtextbox.SelectedText != "")
              {
                  richtextbox.Font = fontDialog1.Font;
              }
      }}
  </code></pre>