title: Optimizing repeated code
body: <p>I have alot of methods who use same line of code:</p>
  
  <pre><code>title.Font = new Font("Arial", 12, FontStyle.Bold);
  </code></pre>
  
  <p>I want to optimize it and just call another function instead create a new font foreach method so I try something like this:</p>
  
  <pre><code>void  titleFont()
  {
      var font = new Font("Arial", 12, FontStyle.Bold);
      return ;
  }
  </code></pre>
  
  <p>and then call as:</p>
  
  <pre><code>title.Font = titleFont();
  </code></pre>
  
  <p>But I get</p>
  
  <blockquote>
    <p>The name 'titleFont' does not exist in the current context</p>
  </blockquote>
  
  <p>What am I doing wrong? Regards</p>