728x90
RepositoryItemImageComboBox imageCombo = new RepositoryItemImageComboBox();
DevExpress.Utils.ImageCollection images = new DevExpress.Utils.ImageCollection();
images.ImageSize = new Size(32, 32);
images.AddImage(Image.FromFile("\\img\\Face_G.png"));
images.AddImage(Image.FromFile("\\img\\Face_Y.png"));
images.AddImage(Image.FromFile("\\img\\Face_R.png"));
imageCombo.SmallImages = images;
imageCombo.Items.Add(new ImageComboBoxItem("좋음", (string)"G", 0));
imageCombo.Items.Add(new ImageComboBoxItem("보통", (string)"Y", 1));
imageCombo.Items.Add(new ImageComboBoxItem("심각", (string)"R", 2));
imageCombo.GlyphAlignment = DevExpress.Utils.HorzAlignment.Near; // Center로 하면 이미지만 보임
imageCombo.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
imageCombo.SelectedIndexChanged += ImageComboBoxEdit_SelectedIndexChanged;
grd.RepositoryItems.Add(imageCombo);
gv.Columns["s"].ColumnEdit = imageCombo;
728x90
반응형
'Software > C#' 카테고리의 다른 글
C# 시작하기 - Mail Send (0) | 2025.01.27 |
---|---|
C# DevExpress - WinForm GridControl CheckEdit (0) | 2025.01.27 |
C# DevExpress - WinForm GridControl ComboBox (0) | 2025.01.27 |
C# DevExpress - Winform GridControl Cell DataBar (0) | 2025.01.27 |
C# 시작하기 - 날짜형 변환 (0) | 2025.01.21 |