FontComboBox

 

public FontFamily SelectedFontFamily
  {

   get
   {

    if (m_comboBox == null)
     return null;

    int index = m_comboBox.SelectedIndex;

    if (index == -1)
     return null;

    return ((Font)m_comboBox.SelectedItem).FontFamily;

   } 

   set
   {

    // Sanity check the combobox before attempting to use it.
    if (m_comboBox == null)
     return;

    int index = -1;

    // Should we look for a matching item?
    if (value != null)
     index = m_comboBox.FindString(value.Name, 0);

    // Select the item.
    m_comboBox.SelectedIndex = index;
    
   } // End set

  }

 转自:http://www.myfirm.cn/News/DotNetUserInterface/20080209014905392.html

 /Files/johnwonder/CGFontComboSrc.rar

自定义属性:

[CGDescription(typeof(CGFontCombo), "selected_index_changed")]
 [CGCategory(typeof(CGFontCombo), "behavior")]
 public event EventHandler SelectedIndexChanged;

/Files/johnwonder/Core.rar

原文地址:https://www.cnblogs.com/johnwonder/p/1671936.html