Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共7 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[求助]更改甘特图片日期的字体

1楼
ppxxww 发表于:2012/1/17 21:25:00
左边的字体能改变,哪里能更改右边甘特图中日期的字体 及列宽
[此贴子已经被作者于2012-1-17 21:41:46编辑过]
2楼
ppxxww 发表于:2012/1/18 11:39:00
表左边的字体能改变,哪里能更改右边甘特图中日期的字体 及列宽
3楼
狐狸爸爸 发表于:2012/1/18 11:46:00

1、列宽的问题? 生成甘特的表的自定义函数BuildGanttTable中,加粗的一行的作用是什么:

 

Dim tbl As Table = Tables("任务")
Tables("窗口1_Table2").StopRedraw()
Dim StartDate As Date = tbl.Compute("Min(开始日期)", "开始日期 IS NOT NULL")
Dim EndDate As Date = tbl.Compute("Max(结束日期)","结束日期 IS NOT NULL")
Dim dt = StartDate
Dim Builder As New DataTableBuilder("统计")
Do
    Dim nm As String = dt.Year & "年" &  dt.Month & "月_" & dt.Day
    Builder.Adddef(nm,Gettype(String),1)
    dt = dt.Adddays(1)
    If dt > Enddate Then
        Exit Do
    End If
Loop
Tables("窗口1_Table2").DataSource = Builder.buildDataSource
For Each cl As Col In Tables("窗口1_Table2").Cols
    Dim cd As Date = cl.Name.Replace("年","-").Replace("月_","-")
    Dim d1 As Date = new Date(cd.year,5,1)
    Dim d2 As Date = new Date(cd.year,10,1)
    If cd.DayOfWeek = 0
        Tables("窗口1_Table2").SetHeaderCellForeColor(cl.name,Color.Red,1)
    ElseIf cd.DayOfWeek = 6
        Tables("窗口1_Table2").SetHeaderCellForeColor(cl.name,Color.green,1)
    ElseIf cd >=d1 AndAlso cd <= d1.AddDays(2)
        Tables("窗口1_Table2").SetHeaderCellForeColor(cl.name,Color.Yellow,1)
    ElseIf cd >=d2 AndAlso cd <= d2.AddDays(6)
        Tables("窗口1_Table2").SetHeaderCellForeColor(cl.name,Color.Yellow,1)
    End If
    cl.width = 20
Next
Functions.Execute("AddGanttRows")
Tables("窗口1_Table2").ResumeRedraw()

 

 

2、设置字体,再加一行即可:

 

Dim tbl As Table = Tables("任务")
Tables("窗口1_Table2").StopRedraw()
Dim StartDate As Date = tbl.Compute("Min(开始日期)", "开始日期 IS NOT NULL")
Dim EndDate As Date = tbl.Compute("Max(结束日期)","结束日期 IS NOT NULL")
Dim dt = StartDate
Dim Builder As New DataTableBuilder("统计")
Tables("窗口1_Table2").Font = New Font("宋体",12,FontStyle.Underline)
Do
    Dim nm As String = dt.Year & "年" &  dt.Month & "月_" & dt.Day
    Builder.Adddef(nm,Gettype(String),1)
    dt = dt.Adddays(1)
    If dt > Enddate Then
        Exit Do
    End If
Loop
Tables("窗口1_Table2").DataSource = Builder.buildDataSource
For Each cl As Col In Tables("窗口1_Table2").Cols
    Dim cd As Date = cl.Name.Replace("年","-").Replace("月_","-")
    Dim d1 As Date = new Date(cd.year,5,1)
    Dim d2 As Date = new Date(cd.year,10,1)
    If cd.DayOfWeek = 0
        Tables("窗口1_Table2").SetHeaderCellForeColor(cl.name,Color.Red,1)
    ElseIf cd.DayOfWeek = 6
        Tables("窗口1_Table2").SetHeaderCellForeColor(cl.name,Color.green,1)
    ElseIf cd >=d1 AndAlso cd <= d1.AddDays(2)
        Tables("窗口1_Table2").SetHeaderCellForeColor(cl.name,Color.Yellow,1)
    ElseIf cd >=d2 AndAlso cd <= d2.AddDays(6)
        Tables("窗口1_Table2").SetHeaderCellForeColor(cl.name,Color.Yellow,1)
    End If
    cl.width = 25
Next
Functions.Execute("AddGanttRows")
Tables("窗口1_Table2").ResumeRedraw()

4楼
ppxxww 发表于:2012/1/18 12:24:00
谢谢您!
5楼
ppxxww 发表于:2012/1/18 12:50:00

1、列宽的问题? 生成甘特的表的自定义函数BuildGanttTable中,加粗的一行的作用是什么:字体偏小,加粗方便看

 

 

我用了Tables("窗口1_Table2").Font = New Font("Arical",10,FontStyle.Bold )改变了甘特图右边,左边用功能键改变为Arical  10  粗体  但左右行不对线,有移位

图片点击可在新窗口打开查看此主题相关图片如下:未命名.jpg
图片点击可在新窗口打开查看

[此贴子已经被作者于2012-1-18 13:14:30编辑过]
6楼
狐狸爸爸 发表于:2012/1/18 16:19:00
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:编码绘制甘特图.rar

7楼
ppxxww 发表于:2012/1/18 16:34:00

谢谢您!

 

共7 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .03027 s, 3 queries.