CDateTimeCtr border

Deeptha S 1 Reputation point

Hi ,

Iam using CDateTimeCtrl datepicker in MFC c++ while creation it has 3D borders ,but i like to set it to normal border .How can i do so?

iam creating datepicker as
CRect(400,0,400,12), this, 3);

it creates a picker control with 3D border by default i like to change the border .

A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
2,757 questions
No comments
{count} votes

4 answers

Sort by: Most helpful
  1. RLWA32 30,216 Reputation points

    Your question is too vague.

    Is your application manifested to use the V6 common controls?

    What styles did you set on the control?

    Don't make us guess.

  2. RLWA32 30,216 Reputation points

    I suspect that your application is not manifested to use the V6 common controls. Earlier versions of the common controls will draw the datetimepicker with the 3d look.

    A typical MFC application created by the Visual Studio new MFC Application template will include a #pragma directive so that the application is properly manifested for the V6 common controls.

    I would include the #pragma directive but for some reason this site will not accept the text.

  3. Jeanine Zhang-MSFT 5,241 Reputation points Microsoft Vendor


    According to your description, does the CDateTimeCtr display as shown below:


    And if you want the CDateTimeCtr to display as shown below:


    If so, I suggest you could try to enable Visual Styles.

    You could add the following compiler directive to your source code:

    #pragma comment(linker,"\"/manifestdependency:type='win32' \  
    name='Microsoft.Windows.Common-Controls' version='' \  
    processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")  

    For more details, I suggest you could refer to the Doc:Enabling Visual Styles.

    Best Regards,

    Jeanine Zhang

  4. RLWA32 30,216 Reputation points

    Its hard to tell what your issues are since using the V6 manifest should work.

    I suggest you start clean with a brand new MFC dialog application created by the new project wizard. It will properly insert the V6 common control manifest. Make sure you build for UNICODE.

    You should be able to instantiate a DateTimeCtrl without a 3d border in that application.