-- 作者:Liangcai
-- 发布时间:2018/11/11 14:19:00
-- 背景颜色发生变化
在查询表DrawCell
dt = e.Table.DataTable If dt.DataCols.Contains("车次") Or dt.DataCols.Contains("班级") Then If e.Col.IsNumeric AndAlso e.Col.Name <> "合计" Then If e.Row.IsNull(e.Col.Name) = False If e.Row(e.Col.Name) > 3 Then dt.AddUserStyle("绿牌",Color.FromARGB(0, 192, 0), Color.DarkSlateGray) e.Style = "绿牌" Else If e.Row(e.Col.Name) <= 3 AndAlso e.Row(e.Col.Name) > 0 Then dt.AddUserStyle("黄牌", Color.Yellow, Color.DarkSlateGray) e.Style = "黄牌" Else If e.Row(e.Col.Name) <= 0 Then dt.AddUserStyle("红牌", Color.Red, Color.DarkSlateGray) e.Style = "红牌" End If End If End If End If
背景颜色有 Color.FromARGB(0, 192, 0)时
If .....? Then Dim sum As Double = 0 For Each c As Col In e.Col If c.Visible = True Then sum += iif(c.width=-1, 98, c.width) End If Next Dim Mb As WinForm.Panel Mb = e.Form.CreateControl("Panel1", ControlTypeEnum.Panel) Mb.Left = sum + 6 \'左边 Mb.Top = 25 \'上边 Mb.Width = 13 \'宽度 Mb.Height = 13 \'高度 Mb.BackColor = Color.FromARGB(0, 192, 0) e.Form.AddControl(Mb)
End If 效果如下,请老师指教,谢谢!
此主题相关图片如下:qq截图20181111140752.png

|