Dim tday As Date = Date.Today
Dim fl As WinForm.PictureViewer = e.Form.Controls("PictureViewer1")
fl.DeleteCommand.Enabled = False
fl.AddCommand.Enabled = False
fl.ClearCommand.Enabled = False
Dim lvw1 As WinForm.ListView = e.Form.Controls("ListView1") '员工列表
Dim lvw2 As WinForm.ListView = e.Form.Controls("ListView2") '活动一参与者列表
Dim lvw3 As WinForm.ListView = e.Form.Controls("ListView3") '活动二参与者列表
Dim lvw4 As WinForm.ListView = e.Form.Controls("ListView4") '活动二参与者列表
Dim lvw5 As WinForm.ListView = e.Form.Controls("ListView5") '活动二参与者列表
Dim lvw6 As WinForm.ListView = e.Form.Controls("ListView6") '活动二参与者列表
Dim lvw8 As WinForm.ListView = e.Form.Controls("ListView8") '活动二参与者列表
Dim lvw9 As WinForm.ListView = e.Form.Controls("ListView9") '活动二参与者列表
Dim lvw10 As WinForm.ListView = e.Form.Controls("ListView10") '活动二参与者列表
Dim lvw11 As WinForm.ListView = e.Form.Controls("ListView11") '活动二参与者列表
Dim lvw12 As WinForm.ListView = e.Form.Controls("ListView12") '活动二参与者列表
Dim lvws() As Winform.ListView = {lvw1,lvw2,lvw3,lvw4,lvw5,lvw6,lvw8,lvw9,lvw10,lvw11,lvw12} '看看我们是怎样批量设置某组控件属性的
For Each lvw As WinForm.ListView In lvws
'lvw.View = ViewMode.Details
lvw.AllowDrag = True
lvw.AllowDrop = True
' lvw.Images.AddSmallImage("Man", "Man.ico") '添加代表男性的一对图标
' lvw.Images.AddSmallImage("Woman", "Woman.ico") '添加代表女性的一对图标
Next
Dim cls() As String = {"下单日期","设计师","开发品类","打样款号"} '定义列名
Dim wds() As Integer = {130,50,72,85} '定义列宽
Dim cls2() As String = {"下单日期","设计师","开发品类","打样款号","目标样板交期"} '定义列名
Dim wds2() As Integer = {110,50,72,85,80} '定义列宽
Dim cls3() As String = {"下单日期","设计师","开发品类","打样款号","要求成衣日期"} '定义列名
Dim wds3() As Integer = {110,50,72,85,80} '定义列宽
lvw1.StopRedraw() '停止绘制
lvw1.Groups.Clear()
lvw1.Columns.Clear() '清除原来的列
lvw1.Rows.Clear() '清除原来的行
lvw1.Images.Clear() '清除原来的图片
lvw1.View = ViewMode.Details '显示模式为详细信息
For i As Integer = 0 To cls.Length - 1 '增加列
Dim c As WinForm.ListViewColumn = lvw1.Columns.Add()
c.Name = cls(i) '指定列名
c.Text = cls(i) '指定标题,这里标题和列名相同
c.Width = wds(i) '指定列宽
Next
For Each zh As String In DataTables("样衣开发").GetValues("开发状态") '增加分组
Dim grp As WinForm.ListViewGroup = lvw1.Groups.Add()
grp.Name = zh
grp.Text = zh & "订单"
Next
Dim drs As List(of DataRow) = DataTables("样衣开发").Select("(开发状态 = '待审核' or 开发状态 = '待分配') and (角色 <> '果壳' or 角色 is null)","下单日期")
For Each dr As DataRow In drs
Dim r As WinForm.ListViewRow = lvw1.Rows.Add() '增加一行
r.Group = dr("开发状态") '指定所属分组
For Each cl As String In cls '逐列取值
r(cl) = dr(cl)
Next
r.Tag = dr
Next
lvw1.ResumeRedraw()