在VC中有DATETIMEPICKER控件
我使用它时,选用了属性中的SHOW NONE项。
定义变量时,只能定义CDatetimeCtrl变量,但在Cdatetimectrl中又 没有show none属性,但在msdn中有datetimepicker类却有show none属性
现在我无法对这个属性控制,操作,那位高手能帮我解决一下问题?
谢谢!!

解决方案 »

  1.   

    CDateTimeCtrl m_datetime;
    m_datetime.ModifyStyle(0, DTS_SHOWNONE);
      

  2.   

    DTS_APPCANPARSE 
    Allows the owner to parse user input and take necessary action. It enables users to edit within the client area of the control when they press the F2 key. The control sends DTN_USERSTRING notification messages when users are finished.DTS_LONGDATEFORMAT 
    Displays the date in long format. The default format string for this style is defined by LOCALE_SLONGDATEFORMAT, which produces output like "Friday, April 19, 1996".DTS_RIGHTALIGN 
    The drop-down month calendar will be right-aligned with the control instead of left-aligned, which is the default. DTS_SHOWNONE 
    It is possible to have no date currently selected in the control. With this style, the control displays a check box that users can check once they have entered or selected a date. Until this check box is checked, the application will not be able to retrieve the date from the control because, in essence, the control has no date. This state can be set with the DTM_SETSYSTEMTIME message or queried with the DTM_GETSYSTEMTIME message.DTS_SHORTDATEFORMAT 
    Displays the date in short format. The default format string for this style is defined by LOCALE_SSHORTDATE, which produces output like "4/19/96".DTS_SHORTDATECENTURYFORMAT 
    Version 5.80. Similar to the DTS_SHORTDATEFORMAT style, except the year is a four-digit field. The default format string for this style is based on LOCALE_SSHORTDATE. The output looks like: "4/19/1996".DTS_TIMEFORMAT 
    Displays the time. The default format string for this style is defined by LOCALE_STIMEFORMAT, which produces output like "5:31:42 PM".DTS_UPDOWN 
    Places an up-down control to the right of the DTP control to modify date-time values. This style can be used in place of the drop-down month calendar, which is the default style.以上是MSDN中列出的DateTimePicker的风格