当前位置:主页>仓库管理软件> 列表

根据一个日期形字段,内容如:2006-3-15,生成树形结 找积分管理软件

财务软件版1楼: 点击年出现月,点击月出现日期

2楼: 自己参考delphi制作TTreeNode,
关于月都是12个,
日期使用个你个函数
function DaysPerMonth(AYear,AMonth:Integer):integer;
const
DaysInMonth:array [1..12]of integer =(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
begin
Result:=DaysInMonth[AMonth];
if (AMonth=2) and IsLeapYear(AYear) then Inc(Result);
end; 如积分管理软件

3楼: 用yearof monthof dayof 取出来生成树

4楼: unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, DateUtils; //要引入DateUnits

type
TForm1 = class(TForm)
TreeView1: TTreeView;
Button1: TButton;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;


implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
i,j,m,d:integer;
YearNode,MonthNode:TTreeNode;
NodeList:TList;
begin
Treeview1.Items.Clear;
YearNode:=TreeView1.Items.AddChild(nil,edit1.Text);
for i:= 1 to 12 do
TreeView1.Items.AddChild(YearNode,inttostr(i));

MonthNode:=YearNode.getFirstChild;
while MonthNode<>nil do
begin
for j:=1 to 31 do
begin
if (j<=28) or ((j>28) and IsValidDate(strtoint(edit1.Text),strtoint(MonthNode.Text ),j)) then
TreeView1.Items.AddChild(MonthNode,inttostr(j));
end; //for
MonthNode:=MonthNode.getNextSibling;
end; //while
end;

end.
//别忘了给分

5楼: 我说的是从一个表的字段,这个字段是日期性的,内容是:2006-7-8
或者2006-7-18等等。
然后根据这个生成树
我刚刚解决,整理一下给大家。

6楼: 终于完成做了一个日期树控件给大家,大家可以去www.tomore.com下载
http://www.tomore.com/2/38157.html