title: Best practice for custom control painting in Winforms?
body: <p>Normally when I override the OnPaint method, I create pens and brushes, etc inside it and then dispose them.</p>
  
  <p>I also read somewhere that instead of recreating these pens and brushes, etc to create them once as static members, and then dispose them once when the form is closed, etc.</p>
  
  <p>Is this a better practice?</p>
  
  <p>Is there a better way for this?</p>
  
  <p>I can assume that since OnPaint is called 1000s (?) of times, that would create a lot of work for the GC compared to creating them only once.</p>