按照帮助文件http://www.foxtable.com/help/index.html?n=0395.htm#userconsent#(在单元格绘制甘特图)任务表中增加了“进度”列(整数),想在单元格中画出进度颜色(gold),代码如下,有个问题,当进度为100时,表现正确,但小于100时,则进度条比例不正确,求解,谢谢
If DrawGannt Then
Dim r As Row = Tables("任务").Rows(e.Row.Index)
Dim dt1 As Date = r("启动日期")
Dim dt2 As Date = r("完成时间")
Dim dt As Date = e.Col.Name.Replace("年","-").Replace("月_","-")
Dim t2 As Table = e.Table
Dim nm As String = dt2.Year & "年" & dt.Month &"月_" & dt.Day
Dim idx As Integer= t2.cols(nm).Index
Dim idx1 As Integer= idx * r("进度")\100
If dt>=dt1 AndAlso dt<=dt2 Then
e.StartDraw()
If dt < Date.Today Then
e.Graphics.FillRectangle(Brushes.springGreen,e.x ,e.y + 5, e.Width, e.Height - 10)
Else
e.Graphics.FillRectangle(Brushes.lightskyblue,e.x ,e.y + 3, e.Width, e.Height - 10)
End If
If dt>=dt1 AndAlso dt <= t2.cols(idx1).Name.Replace("年","-").Replace("月_","-") Then
e.Graphics.FillRectangle(Brushes.gold,e.x ,e.y + 2, e.Width, e.Height - 10)
End If
e.EndDraw()
End If
End If