Как изменить ForeColor выбранного элемента ComboBox?

Можно ли изменить внешний вид выбранного (не выпадающего!) Элемента?

combobox.ForeColor изменяет цвет текста только для всех элементов в раскрывающемся списке.

Изменить: Варианты ниже, наш

 public static void CBoxDrawItem(object sender, DrawItemEventArgs args)
    {
        var box = sender as ComboBox;
        if (box == null || args.Index < 0 || args.Index >= box.Items.Count)
            return;

        e.DrawBackground();
        var data = box.Tag as ControlData;
        var color = (args.State & DrawItemState.ComboBoxEdit) == 0 || data == null || !data.IsInDefaultState
            ? e.ForeColor : GetDefaultColor(e.ForeColor);
        using (var brush = new SolidBrush(color))
        {
            args.Graphics.DrawString(box.Items[args.Index].ToString(), args.Font, brush, args.Bounds.X, args.Bounds.Y);
        }
        args.DrawFocusRectangle();
    }
5
задан Lonli-Lokli 16 March 2011 в 12:42
поделиться