Hi,
You can override the
OnDrawItem
of the combo box. Under this overrided method firstly fill the rectangle and then draw the rectangle using its graphics. I have done it in C#. Here is the code.
<br />
m_Color = Color.FromName((string)base.Items[e.Index]);<br />
g.FillRectangle(new SolidBrush(m_Color), e.Bounds.X + this.inMargin, e.Bounds.Y + this.inMargin, e.Bounds.Width / this.boxWidth - 2 * this.inMargin, e.Bounds.Height - 2 * this.inMargin);<br />
<br />
g.DrawRectangle(Pens.Black, e.Bounds.X + this.inMargin, e.Bounds.Y + this.inMargin, e.Bounds.Width / this.boxWidth - 2 * this.inMargin, e.Bounds.Height - 2 * this.inMargin);<br />
Let me know in questions.
Thanks,
Bhasker