Dim ct As New Windows.Forms.ListView
ct.Dock = Windows.Forms.DockStyle.Fill
ct.Name = "ListView1"
'ct.LargeImageList = ImageList '这个可以正常显示图标
ct.SmallImageList = ImageList '这个就无法正常显示图标
e.Form.Controls("Panel1").BaseControl.Controls.Add(ct)
AddHandler ct.Click, AddressOf QJ_doubleclick
Dim Multi As String = DataTables("main").GetComboListString("分组名称", "[大类名称] = '首页'")
Dim Values() As String
Values = Multi.Split("|")
For Index As Integer = 0 To Values.Length - 1
Dim s As Windows.Forms.ListViewGroup = New Windows.Forms.ListViewGroup(Values(Index), Windows.Forms.HorizontalAlignment.Center) '指定的标题文本和指定的标题的对齐方式
e.Form.Controls("Panel1").BaseControl.Controls("ListView1").Groups.Add(s)
For Each R As DataRow In DataTables("main").Select(" 分组名称 = '" & Values(Index) & "' ")
Dim it As New Windows.Forms.ListViewItem
it.Text = R("分类名称")
it.Group = s
it.ImageIndex = R("分类名称")
e.Form.Controls("Panel1").BaseControl.Controls("ListView1").Items.Add(it)
Next
Next
[此贴子已经被作者于2017/10/17 19:28:15编辑过]