Fill ComboBox with List of available Fonts

后端 未结 7 2268
無奈伤痛
無奈伤痛 2020-12-10 00:29

How can I fill a combo-box with a list of all the available fonts in the system?

7条回答
  •  清歌不尽
    2020-12-10 00:59

    ComboBox1.ItemsSource = new InstalledFontCollection().Families;
    

    and for the first time selected item:

    private void Combo1_Loaded(object sender, RoutedEventArgs e)
    {
        ComboBox1.Text = "Tahoma";
    }
    

提交回复
热议问题