Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
我在编写排产表
要把今天的列用颜色标记出来,怎么标记。
我知道标记列标题:
Tables("排产表").SetHeaderCellBackColor("D0",Color.Yellow,1)
但不知道怎么标记一整列,难道:
For I = 1 to Tables("排产表").Count
Tables("排产表").SetHeaderCellBackColor("D0",Color.Yellow,1)
Next
这样??
有没有简单的啊,我要标记好几列。
我的排产表是临时表啊!
'排产表
Dim Td As Date = Date.Today
Dim Name As String
Dim I As Short
Dim dtb As New DataTableBuilder("排产表")
dtb.AddDef("生产组", Gettype(String), 4)
dtb.AddDef("产品编号", Gettype(String), 12)
dtb.AddDef("令号", Gettype(String), 6)
For I = -3 To 0
dtb.AddDef("D" & I, Gettype(Integer))
dtb.AddDef("S" & I, Gettype(Integer))
Next
For I = 1 To 14
dtb.AddDef("D" & I, Gettype(Integer))
Next
dtb.Build()
Tables("排产表").StopRedraw
'调整列宽
With Tables("排产表")
.Cols("生产组").Width = 40
.Cols("产品编号").Width = 70
.Cols("令号").Width = 45
For I = -3 To 14
.Cols("D" & I).Width = 40
Next
For I = -3 To 0
.Cols("S" & I).Width = 40
Next
End With
'重写列标题
Dim Cap As String
Dim ThatD As Date
For I = -3 To 14
ThatD = Td.AddDays(I)
If ThatD.DayOfWeek = 0 Then
Cap = "休息"
Else
Cap = ThatD.Day & "日"
End If
DataTables("排产表").DataCols("D" & I).Caption = ThatD.Year & "年" & ThatD.Month & "月" & "_" & Cap
Next
For I = -3 To 0
ThatD = Td.AddDays(I)
Cap = ThatD.Day & "实"
DataTables("排产表").DataCols("S" & I).Caption = ThatD.Year & "年" & ThatD.Month & "月" & "_" & Cap
Next
DataTables("排产表").BuildHeader()
'颜色标记
For I = -3 To -1
Tables("排产表").SetHeaderCellBackColor("D" & I,Color.Red,1)
Next
Tables("排产表").SetHeaderCellBackColor("D0",Color.Yellow,1)
Tables("排产表").ResumeRedraw
临时表没有DrawCell~ ~b
自己搞定了,,虽然代码很繁琐
'颜色标记
N = Plans.Count
For I = -3 To -1
For I1 = 2 To N
Tables("排产表").SetHeaderCellBackColor("D" & I,Color.Red,I1)
Next
Next
For I = -3 To -0
For I1 = 2 To N
Tables("排产表").SetHeaderCellBackColor("S" & I,Color.Green,I1)
Next
Next
For I1 = 2 To N
Tables("排产表").SetHeaderCellBackColor("D0",Color.Yellow,I1)
Next
也可以标记表里面的内容的啊.呵呵
也可以标记表里面的内容的啊.呵呵
-------------------------------------------------------------------------------------
高!这都给你试出来.这样一来,就很容易有条件地标记数据了
SetHeaderCellBackColor
设置指定列的标题的背景颜色呀。