Click here to Skip to main content
15,885,182 members
Articles / Desktop Programming / MFC

Editable Date Picker

Rate me:
Please Sign up or sign in to vote.
4.78/5 (24 votes)
24 Jan 2008CPOL6 min read 331.7K   9.6K   92  
Fully editable date picker control based on CDateTimeCtrl
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
#ifndef RT_MANIFEST
#define RT_MANIFEST 24
#endif // RT_MANIFEST

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (U.K.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
#pragma code_page(1252)
#endif //_WIN32

/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_ABOUTBOX DIALOGEX 0, 0, 235, 55
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About DateTimeEditCtrl Demo"
FONT 8, "MS Sans Serif", 0, 0, 0x0
BEGIN
    ICON            IDR_MAINFRAME,IDC_STATIC,11,17,20,20
    LTEXT           "DateTimeEditCtrl Demo Version 3.7",IDC_STATIC,40,10,119,8,SS_NOPREFIX
    LTEXT           "Copyright (C) 2003-2008 Paul S. Vickery",IDC_STATIC,40,25,188,8
    DEFPUSHBUTTON   "OK",IDOK,178,7,50,14,WS_GROUP
END

IDD_DATETIMEEDITCTRLDEMO_DIALOG DIALOGEX 0, 0, 266, 143
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "DateTimeEditCtrl Demo"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
    GROUPBOX        "&Date/Time Control",IDC_STATIC,7,7,148,31
    CONTROL         "DateTimePicker1",IDC_DATETIMEPICKER1,"SysDateTimePick32",WS_TABSTOP,13,17,134,15
    LTEXT           "Type or select a date in the control above",IDC_LABEL_VALIDITY_RESULTS,7,40,148,8,SS_NOPREFIX
    GROUPBOX        "Options",IDC_STATIC,13,50,134,68
    CONTROL         "Only allow valid chars",IDC_BTN_VALID_CHARS_ONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,63,84,10
    CONTROL         "Default (numeric + date sep)",IDC_BTN_DEFAULT,"Button",BS_AUTORADIOBUTTON | WS_GROUP,28,75,105,10
    CONTROL         "Specified:",IDC_BTN_SPECIFIED,"Button",BS_AUTORADIOBUTTON,28,87,47,10
    EDITTEXT        IDC_EDIT_VALID_CHARS,39,98,101,14,ES_AUTOHSCROLL | WS_GROUP
    LTEXT           "&Notifications:",IDC_STATIC,162,7,97,8
    LISTBOX         IDC_LIST_NOTIFY,162,16,97,96,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
    DEFPUSHBUTTON   "OK",IDOK,42,122,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,108,122,50,14
    PUSHBUTTON      "C&lear",IDC_BTN_CLEAR_LIST,174,122,50,14
END


/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
 FILEVERSION 3,6,1,0
 PRODUCTVERSION 3,6,1,0
 FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x4L
 FILETYPE 0x1L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904b0"
        BEGIN
            VALUE "FileDescription", "DateTimeEditCtrlDemo MFC Application"
            VALUE "FileVersion", "3, 6, 1, 0"
            VALUE "InternalName", "DateTimeEditCtrlDemo"
            VALUE "LegalCopyright", "Copyright (C) 2003-2007 Paul S. Vickery"
            VALUE "OriginalFilename", "DateTimeEditCtrlDemo.EXE"
            VALUE "ProductName", "DateTimeEditCtrlDemo Application"
            VALUE "ProductVersion", "3, 6, 1, 0"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1200
    END
END


/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//

#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO 
BEGIN
    IDD_ABOUTBOX, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 228
        TOPMARGIN, 7
        BOTTOMMARGIN, 48
    END

    IDD_DATETIMEEDITCTRLDEMO_DIALOG, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 259
        VERTGUIDE, 13
        VERTGUIDE, 20
        VERTGUIDE, 147
        VERTGUIDE, 155
        VERTGUIDE, 162
        TOPMARGIN, 7
        BOTTOMMARGIN, 136
        HORZGUIDE, 44
        HORZGUIDE, 112
    END
END
#endif    // APSTUDIO_INVOKED


#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE 
BEGIN
    "resource.h\0"
END

2 TEXTINCLUDE 
BEGIN
    "#include ""afxres.h""\r\n"
    "#ifndef RT_MANIFEST\r\n"
    "#define RT_MANIFEST 24\r\n"
    "#endif // RT_MANIFEST\r\n"
    "\0"
END

3 TEXTINCLUDE 
BEGIN
    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
    "#define _AFX_NO_OLE_RESOURCES\r\n"
    "#define _AFX_NO_TRACKER_RESOURCES\r\n"
    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
    "\r\n"
    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
    "#ifdef _WIN32\r\n"
    "LANGUAGE 9, 1\r\n"
    "#pragma code_page(1252)\r\n"
    "#endif //_WIN32\r\n"
    "#include ""res\\DateTimeEditCtrlDemo.rc2""  // non-Microsoft Visual C++ edited resources\r\n"
    "#include ""afxres.rc""         // Standard components\r\n"
    "#endif\r\n"
    "\0"
END

#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME           ICON                    "res\\DateTimeEditCtrlDemo.ico"

/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//

IDB_CALENDAR            BITMAP                  "res\\calendar.bmp"
IDB_CALENDAR_DISABLED   BITMAP                  "res\\calendar_disabled.bmp"

/////////////////////////////////////////////////////////////////////////////
//
// RT_MANIFEST
//

1                       RT_MANIFEST             "res\\manifest.xml"

/////////////////////////////////////////////////////////////////////////////
//
// String Table
//

STRINGTABLE 
BEGIN
    IDS_ABOUTBOX            "&About DateTimeEditCtrl Demo..."
END

#endif    // English (U.K.) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif //_WIN32
#include "res\DateTimeEditCtrlDemo.rc2"  // non-Microsoft Visual C++ edited resources
#include "afxres.rc"         // Standard components
#endif

/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United Kingdom United Kingdom
Originally from an electronics background, I moved into software in 1996, partly as a result of being made redundant, and partly because I was very much enjoying the small amount of coding (in-at-the-deep-end-C) that I had been doing!

I swiftly moved from C to C++, and learned MFC, and then went on to real-time C on Unix. After this I moved to the company for which I currently work, which specialises in Configuration Management software, and currently program mainly in C/C++, for Windows. I have been gradually moving their legacy C code over to use C++ (with STL, MFC, ATL, and WTL). I have pulled in other technologies (Java, C#, VB, COM, SOAP) where appropriate, especially when integrating with third-party products.

In addition to that, I have overseen the technical side of the company website (ASP, VBScript, JavaScript, HTML, CSS), and have also worked closely with colleagues working on other products (Web-based, C#, ASP.NET, SQL, etc).

For developing, I mainly use Visual Studio 2010, along with an in-house-designed editor based on Andrei Stcherbatchenko's syntax parsing classes, and various (mostly freeware) tools. For website design, I use Dreaweaver CS3.

When not developing software, I enjoy listening to and playing music, playing electric and acoustic guitars and mandolin.

Comments and Discussions