想做一个类似month calenda的东西,
日 一 二 三 四 五 六
      1  2  3  3  4
5  6  7  8  9 10.....(余下的省略)日期想用lable做,问题因为每个月的日期排列不用,怎样知道每个月的某天是星期几??

解决方案 »

  1.   

    DayOfWeek functionSee also ExampleReturns the day of the week for a specified date.UnitSysutilsCategorydate/time routinesfunction DayOfWeek(Date: TDateTime): Integer;DescriptionDayOfWeek returns the day of the week of the specified date as an integer between 1 and 7, where Sunday is the first day of the week and Saturday is the seventh.
      

  2.   

    做这个有什么用呢?
    office中有现成的activex组件可以使用(中文版的)
    delphi的某个面板上也有(英文版)
      

  3.   

    刚才的朋友已经给你说了,不过是英文的,我再给你解释一下。
    1 使用DayOfWeek函数
      声明格式是:function DayOfWeek(Date: TDateTime): Integer;
      返回值1~7,1表示星期日,7表示星期六
      参数Date是日期时间类型,注意把年月日用EncodeDate函数转化为TDateTime类型2 该函数是一个Delphi运行函数,其定义在SysUtils单元中,需要在前面uses SysUtils即可