1。如何提取combobox的选取值?
2。如何提取datetimepicker的选取值?
3。如何获得memo的输入内容?
4。有什么控件对时间输入比较方便,最好能检测输入的合法性?如何得到当前系统的时间,年,月,日,星期几,想做一个日立。请给出部分代码。谢谢。(菜)

解决方案 »

  1.   

    得到年,月,日,星期几
    在uses 引用DateUnits
    var
      Year,Month,Day,Week:integer;
    begin
      year:=YearOf(Now);
      Month:=MonthOf(Now);
      Day:=DayOf(now);
      Week:=DayOfWeek(Now);
    end;
      

  2.   

    1.Combobox1.text;
    2.datetimepicker1.text;
    3.memo1.text;
    4.用MaskEdit组件
      

  3.   

    1、Combobox1.text;
    2、DateTimePicker1.DateTime
    3、memo1.text
    4、最好用DateTimePicker
    5、DecodeDate(),DecodeTime()或DecodeDateTime()
       星期用DecodeDateWeek()
     var
       Present: TDateTime;
       Year, Month, Day, Hour, Min, Sec, MSec: Word;
     begin
       Present:= Now;
       DecodeDate(Present, Year, Month, Day);
       Label1.Caption := 'Today is Day ' + IntToStr(Day) + ' of Month '
         + IntToStr(Month) + ' of Year ' + IntToStr(Year); 
       DecodeTime(Present, Hour, Min, Sec, MSec);
       Label2.Caption := 'The time is Minute ' + IntToStr(Min) + ' of Hour '
         + IntToStr(Hour);
     End;