SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
This sample illustrates date, time and number formatting.
This is not an executable sample, so a complete project is not provided. These statements are intended to show basic concepts and the syntax used.
BOOL CProject1Dlg::OnInitDialog() { CDialog::OnInitDialog(); m_pMask1 = m_Mask1.GetControlUnknown(); _ASSERT(m_pMask1 != NULL); CComBSTR FmtVal; m_pMask1->Calculator->FormatCurrency(48533.85, -1, -1, -1, _bstr_t(_T("")), _bstr_t(_T("")), -1, -1, _bstr_t(_T("")), &FmtVal); AfxMessageBox(CString(FmtVal)); FmtVal = _T("short"); m_pMask1->Calendar->FormatDate(COleDateTime(2000, 8, 1, 0,0,0), &FmtVal); AfxMessageBox(CString(FmtVal)); FmtVal = _T("long"); m_pMask1->Calendar->FormatDate(COleDateTime(2000, 8, 1, 0,0,0), &FmtVal); AfxMessageBox(CString(FmtVal)); FmtVal = _T("dddd, MMMM d 'in the year' yyyy"); m_pMask1->Calendar->FormatDate(COleDateTime(2000, 8, 1, 0,0,0), &FmtVal); AfxMessageBox(CString(FmtVal)); m_pMask1->Calculator->FormatNumber(48533.85, -1, -1, -1, _bstr_t(_T("")), _bstr_t(_T("")), -1, &FmtVal); AfxMessageBox(CString(FmtVal)); FmtVal = _T(""); m_pMask1->Calendar->FormatTime(COleDateTime(2000, 8, 1, 5, 1, 59), &FmtVal); AfxMessageBox(CString(FmtVal)); FmtVal = _T("'Hour='H 'Mins='m 'Secs='s"); m_pMask1->Calendar->FormatTime(COleDateTime(2000, 8, 1, 5, 1, 59), &FmtVal); AfxMessageBox(CString(FmtVal)); short Year, Month, Day, DayOfWeek; m_pMask1->Calendar->GetDateInfo(COleDateTime(2000, 7, 14, 5,49,23), &Year, &Month, &Day, &DayOfWeek); CString str; str.Format(_T("Year=%d Month=%d Day=%d DayOfWeek=%d"), Year, Month, Day, DayOfWeek); AfxMessageBox(str); short Hours, Minutes, Seconds; m_pMask1->Calendar->GetTimeInfo(COleDateTime(2000, 7, 14, 5,49,23), &Hours, &Minutes, &Seconds); str.Format(_T("Hours=%d Minutes=%d Seconds=%d"), Hours, Minutes, Seconds); AfxMessageBox(str); return TRUE; }