管理员LiuXiao您好。
经测试,控件中的“年”是按公历的年定义的,跟“月”(节气)无关?不知我的看法是否正确?或者还要用哪一个函数,我基本不懂(我只会仿你们的代码)。请指教,多谢!
以下是我的测试过程。
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
YearEdit: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses CnCalendar, CnCalClass;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
HourObj: TCnHourObj;
begin
HourObj:=TCnHourObj.Create;
HourObj.Year:=StrtoInt(Trim(YearEdit.Text)); //2005;
Showmessage(GetGanZhiFromNumber(HourObj.YearGanZhi));
end;
end.
|