DEV ImageComboxEdit 使用
初始化:
DevExpress.XtraEditors.ImageComboBoxEdit imageComboBox=new DevExpress.XtraEditors.ImageComboBoxEdi();
图片容器:
DevExpress.Utils.ImageCollection imageCollection;
设置ImageComboxEdit 的图片集合:
imageComboBox.Properties.SmallImages=imageCollection;
添加子项:
ImageComboBoxItem item = new ImageComboBoxItem();
item.Value =“类似Tag功能”;
item.ImageIndex =(int型,在imageCollection中的索引);
item.Description = “显示文本”;
imageComboBox.Properties.Items.Add(item);
使用:
object value= (imageComboBox.SelectedItem as ImageComboBoxItem).Value;
string text=(imageComboBox.SelectedItem as ImageComboBoxItem).Text;