Я установил событие DrawItem в выпадающем списке. Также установите
this.comboBox1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
Это код, который я использовал для DrawItem:
private void comboBox1_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
{
var rc = new System.Drawing.Rectangle(e.Bounds.X , e.Bounds.Y,
e.Bounds.Width, e.Bounds.Height);
var sf = new System.Drawing.StringFormat
{
Alignment = System.Drawing.StringAlignment.Far
};
string str = (string)comboBox1.Items[e.Index];
if (e.State == (DrawItemState.Selected | DrawItemState.NoAccelerator
| DrawItemState.NoFocusRect) ||
e.State == DrawItemState.Selected)
{
e.Graphics.FillRectangle(new System.Drawing.SolidBrush(System.Drawing.Color.CornflowerBlue), rc);
e.Graphics.DrawString(str, this.comboBox1.Font, new System.Drawing.SolidBrush(System.Drawing.Color.Cyan), rc, sf);
}
else
{
e.Graphics.FillRectangle(new System.Drawing.SolidBrush(System.Drawing.Color.White), rc);
e.Graphics.DrawString(str, this.comboBox1.Font, new System.Drawing.SolidBrush(System.Drawing.Color.Black), rc, sf);
}
}
Вот как это выглядит: