title: Override DrawItem of ComboBox
body: <p>I changed the highlight color of various of the controls, and I am planning to make more changes. So I though is better to create my own controls and reuse them instead of making the changed for each and every one of them.</p>
  
  <p>I created a new user control, and inherited from <code>System.Windows.Forms.ComboBox</code>.
  The problem is I cannot find a way to override <code>onDraw</code> like I would for <code>onClick</code>.</p>
  
  <p>So how I would go and override it? Here is the code I used for each control <code>onDraw</code> event</p>
  
  <pre><code>public void comboMasterUsers_DrawItem(object sender, DrawItemEventArgs e)
      {
          e.DrawBackground();
  
          Graphics g = e.Graphics;
          Brush brush = ((e.State &amp; DrawItemState.Selected) == DrawItemState.Selected) ?
                        Brushes.LightSeaGreen : new SolidBrush(e.BackColor);
  
          g.FillRectangle(brush, e.Bounds);
          e.Graphics.DrawString(comboMasterUsers.Items[e.Index].ToString(), e.Font,
                   new SolidBrush(e.ForeColor), e.Bounds, StringFormat.GenericDefault);
  
          e.DrawFocusRectangle();
      }
  </code></pre>
  
  <p>Thanks!</p>