https://docs.devexpress.com/VCL/179004/ExpressGanttControl/getting-started/getting-started
procedure TForm3.FormCreate(Sender: TObject); begin dxGanttControl1.LoadFromFile('test.xml'); //加载 任务 end; procedure TForm3.保存任务Click(Sender: TObject); begin dxGanttControl1.SaveToFile('test.xml'); end;
两个任务的关联
在右边 持续 界面中,按住第一个任务,等鼠标 变化, 放松到目标 任务即可。
用代码添加任务
uses DateUtils; procedure TForm3.Button1Click(Sender: TObject); var ADate: TDateTime; ATask: TdxGanttControlTask; ATaskCollection: TdxGanttControlTasks; I: Integer; begin ATaskCollection := dxGanttControl1.DataModel.Tasks; // Provides access to the task collection ADate := EncodeDateTime(2024, 03, 19, 8, 0, 0, 0); //第一个任务的 时间 for I := 1 to 10 do //10 个任务 begin ATask := ATaskCollection.Append; // Appends a task to the collection ATask.Manual := False; // Specifies that a task is automatically scheduled ATask.OutlineLevel := 1; // Specifies a task's nesting level ATask.Start := ADate; // Assigns a start date to a task ATask.Finish := ADate + EncodeTime(9, 0, 0, 0); // Assigns a finish date to a task ATask.Name := 'Task #' + IntToStr(I); // Specifies a task name if I > 1 then ATask.PredecessorLinks.Append.PredecessorUID := ATaskCollection[ATaskCollection.Count - 2].UID; // Links a task to a predecessor ADate := IncDay(ADate); // Checks if a task is planned on a workday while not dxGanttControl1.DataModel.ActiveCalendar.IsWorkday(ADate) do ADate := IncDay(ADate); end; end;
delphi dxGanttControl1 汉化
其他类似
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
2023-03-06 为uniDBGrid设置文字操作栏(61)