XtraEditors六、ListBoxControl、CheckedListBoxControl、ImageListBoxControl

 

ListBoxControl

效果如下:

XtraEditors六、ListBoxControl、CheckedListBoxControl、ImageListBoxControl

示例代码:

string[] girlArr = { "面码", "Saber", "Mathilda" };
// Set the listBox's background color
listBoxControl1.BackColor = Color.FromArgb(254, 246, 212);
// Dock to all edges and fill the parent container
listBoxControl1.Dock = DockStyle.Fill;
// Add items
listBoxControl1.Items.AddRange(girlArr);

 

CheckedListBoxControl

该控件以列表框的形式显示复选列表;

效果如图:

XtraEditors六、ListBoxControl、CheckedListBoxControl、ImageListBoxControl

 


示例代码:

CheckedListBoxItem[] itemArr = {
                     new CheckedListBoxItem("January",false),
                     new CheckedListBoxItem("February", false),
                     new CheckedListBoxItem("March", false),
                     new CheckedListBoxItem("April", false),
                     new CheckedListBoxItem("May", false),
                     new CheckedListBoxItem("June", true),
                     new CheckedListBoxItem("July", true),
                     new CheckedListBoxItem("August", false),
                     new CheckedListBoxItem("September", false),
                     new CheckedListBoxItem("October", false),
                     new CheckedListBoxItem("November", false),
                     new CheckedListBoxItem("December", false)
};
checkedListBoxControl1.Items.AddRange(itemArr);

 

ImageListBoxControl控件

https://www.devexpress.com/Support/Center/Question/Details/T106420/how-to-show-image-in-imagelistboxcontrol

1. 新建窗体

2. 拖入ImageListBoxControl控件

3. 拖入ImageCollection控件

4. 设置ImageListBoxControl的ImageList属性为imageCollection1

5. 设置ImageCollection的图片,右击选择: Choose Images

6. 点击窗体上ImageListBoxControl右上角的小箭头,选择Edit Items,设置ImageIndex

XtraEditors六、ListBoxControl、CheckedListBoxControl、ImageListBoxControl

 

ImageListBoxControl 列表框中的每一项都有显示图片的能力;

imageListBoxControl1.Items.Add("面码");
imageListBoxControl1.Items.Add("Saber");
imageListBoxControl1.Items.Add("Mathilda");

imageListBoxControl1.Items[0].ImageIndex = 0;
imageListBoxControl1.Items[1].ImageIndex = 1;
imageListBoxControl1.Items[2}.ImageIndex = 2;

效果如下:

XtraEditors六、ListBoxControl、CheckedListBoxControl、ImageListBoxControl

 

相关文章:

  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-06
  • 2021-10-17
  • 2021-12-30
  • 2021-07-20
  • 2021-06-26
  • 2022-01-10
相关资源
相似解决方案