谢谢老师,以前这个是设定的如果完成计划的列没有时间就显示到当天。老师帮忙看看是不是这里的这几段代码出错了呀? 内容有点复杂,感谢了,

此主题相关图片如下:搜狗截图19年09月04日1413_1.png

drawcell里面
If DrawGannt AndAlso e.Row.Index >= 0 AndAlso e.Row.Index < Tables("计划表窗口_Table4").Rows.count Then
Dim r As Row = Tables("计划表窗口_Table4").Rows(e.Row.Index)
Dim dt As Date = e.Col.Name.Replace("year","-").Replace("month_","-").split("_")(0)
If r.IsNull("计划_开始日期") OrElse r.IsNull("计划_完成日期") Then
Else
Dim dt1 As Date = r("计划_开始日期")
Dim dt2 As Date = r("计划_完成日期")
If dt>=dt1 AndAlso dt<=dt2 Then
e.StartDraw()
If dt < Date.Today Then
e.Graphics.FillRectangle(Brushes.Cyan,e.x ,e.y + 1, e.Width, e.Height - 5)
Else
e.Graphics.FillRectangle(Brushes.Cyan,e.x ,e.y + 1, e.Width, e.Height - 5)
End If
e.EndDraw()
End If
End If
If r.IsNull("进行_开始日期")=False Then
Dim dt3 As Date = r("进行_开始日期")
Dim dt4 As Date = iif(r.Isnull("进行_完成日期"), Date.Today, r("进行_完成日期"))
If dt>=dt3 AndAlso dt<=dt4 Then
e.Graphics.FillRectangle(Brushes.Blue,e.x ,e.y + 4, e.Width, e.Height - 11)
End If
End If
Dim fdr As DataRow = DataTables("记事表").find("事件日期=#" & dt & "# and 项目名称='" & r("项目名称") & "' and 项目流程='" & r("项目流程") & "' and 处理状态='未处理'")
If fdr IsNot Nothing Then
'e.Graphics.FillRectangle(Brushes.Red,e.x ,e.y, e.Width, e.Height) '方形
e.Graphics.FillPie(Brushes.Red,e.x ,e.y, e.Width, e.height,0,360) '原形
End If
End If
doubleclick里面的
Dim t As Table = Tables("计划表窗口_Table9")
Dim dt As Date = t.Cols(t.colsel).Name.Replace("year","-").Replace("month_","-").split("_")(0)
Dim r As Row = Tables("计划表窗口_Table4").Rows(t.Position)
'Dim fdr As DataRow = DataTables("记事表").find("事件日期=#" & dt & "# and 项目名称='" & r("项目名称") & "' and 项目流程='" & r("项目流程") & "'")
'Dim fdr As DataRow = DataTables("记事表").find("事件日期=#" & dt & "# and 项目名称='" & r("项目名称") & "' and 项目流程='" & r("项目流程") & "' and 事件日期='" & r("事件日期") & "'")
Dim fdr As DataRow = DataTables("记事表").find("事件日期=#" & dt & "# and 项目名称='" & r("项目名称") & "' and 项目流程='" & r("项目流程") & "' and 事件日期='" & dt & "'")
If fdr IsNot Nothing Then
'msgbox(1)
Forms("记事表编辑窗口").show
Else
Forms("添加事件窗口").show
Forms("添加事件窗口").Controls("DateTimePicker1").text = dt
Forms("添加事件窗口").Controls("TextBox1").text = r("项目名称")
Forms("添加事件窗口").Controls("TextBox2").text = r("项目流程")
End If
mouseentercell里面的
If DrawGannt AndAlso e.Row.Index >= 0 AndAlso e.Row.Index < Tables("计划表窗口_Table4").Rows.count Then
Dim r As Row = Tables("计划表窗口_Table4").Rows(e.Row.Index)
Dim dt As Date = e.Col.Name.Replace("year","-").Replace("month_","-").split("_")(0)
If r.IsNull("计划_开始日期") OrElse r.IsNull("计划_完成日期") Then
Else
Dim dt1 As Date = r("计划_开始日期")
Dim dt2 As Date = r("计划_完成日期")
If dt>=dt1 AndAlso dt<=dt2 Then
e.Table.ShowToolTip(r("项目内容") & " " & r("办理人"),e.Row,e.Col)
End If
End If
If r.IsNull("进行_开始日期")=False Then
Dim dt3 As Date = r("进行_开始日期")
Dim dt4 As Date = iif(r.Isnull("进行_完成日期"), Date.Today, r("进行_完成日期"))
If dt>=dt3 AndAlso dt<=dt4 Then
e.Table.ShowToolTip(r("项目内容") & " " & r("办理人"),e.Row,e.Col)
End If
End If
Dim fdr As DataRow = DataTables("记事表").find("事件日期=#" & dt & "# and 项目名称='" & r("项目名称") & "' and 项目流程='" & r("项目流程") & "' and 处理状态='未处理'")
If fdr IsNot Nothing Then
e.Table.ShowToolTip(fdr("事件内容") & " " & fdr("办理人"),e.Row,e.Col)
End If
End If