有没有办法改变ComboBox的“ DropDown”字体

时间:2018-10-07 01:20:55

标签: c# .net winforms fonts combobox

我有一个ComboBox包含Unicode个符号,该字体设置为支持Unicode的字体,并且显示效果很好。但是DropDown部分似乎使用了无法显示这些Unicode symbols的标准字体。是否可以在属性中更改此设置,还是必须创建自定义的ComboBox控件?

DropDown-Section of a ComboBox

编辑:

我的代码:

public class MainWindow : Form {
    ...

    public BindingList<Sound> Sounds { get; set; } = new BindingList<Sound>();
    public MainWindow() {
        InitializeComponent();
        this.comboBox.DataSource = this.Sounds;
    }

    ...
}

public class Sound {
    public char Symbol { get; private set; }
    public Sound(char symbol) {
        this.Symbol = symbol;
    }

    public override int GetHashCode() {
        return this.Symbol.GetHashCode();
    }

    public override bool Equals(object obj) {
        if(obj is Sound) {
            return this.Symbol == ((Sound)obj).Symbol;
        }
        return base.Equals(obj);
    }

    public override string ToString() {
        return this.Symbol.ToString();
    }

    public void Play() {
        ...
    }
}

0 个答案:

没有答案