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 various Masked Edit controls.
The source code is located at C:\Program Files (x86)\Softelvdm\SftMask OCX 7.0\Samples\VC++\Sample1\Sample1Dlg.cpp or C:\Program Files\Softelvdm\SftMask OCX 7.0\Samples\VC++\Sample1\Sample1Dlg.cpp (on 32-bit Windows versions).
BOOL CSample1Dlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon m_vSftMaskPhone = GetDlgItem(IDC_SFTMASKPHONE)->GetControlUnknown(); _ASSERT(m_vSftMaskPhone != NULL); m_vSftMaskSSN = GetDlgItem(IDC_SFTMASKSSN)->GetControlUnknown(); _ASSERT(m_vSftMaskSSN != NULL); m_vSftMaskTodaysDate = GetDlgItem(IDC_SFTMASKTODAYSDATE)->GetControlUnknown(); _ASSERT(m_vSftMaskTodaysDate != NULL); m_vSftMaskTime = GetDlgItem(IDC_SFTMASKTIME)->GetControlUnknown(); _ASSERT(m_vSftMaskTime != NULL); m_vSftMaskPercent = GetDlgItem(IDC_SFTMASKPERCENT)->GetControlUnknown(); _ASSERT(m_vSftMaskPercent != NULL); m_vSftMaskAmount = GetDlgItem(IDC_SFTMASKAMOUNT)->GetControlUnknown(); _ASSERT(m_vSftMaskAmount != NULL); m_vSftMaskIPAddr = GetDlgItem(IDC_SFTMASKIPADDR)->GetControlUnknown(); _ASSERT(m_vSftMaskIPAddr != NULL); m_vSftMaskPswd = GetDlgItem(IDC_SFTMASKPSWD)->GetControlUnknown(); _ASSERT(m_vSftMaskPswd != NULL); // phone number m_vSftMaskPhone->Text = _bstr_t(_T("9415058600")); m_vSftMaskPhone->SelStart = 1; // social security number m_vSftMaskSSN->Text = _bstr_t(_T("444-12-1111")); // today's date m_vSftMaskTodaysDate->Contents->DateTime = COleDateTime::GetCurrentTime();; // time m_vSftMaskTime->Contents->DateTime = COleDateTime::GetCurrentTime();; // percentage m_vSftMaskPercent->Contents->Value[0] = COleVariant(50L); // amount m_vSftMaskAmount->Text = _bstr_t(_T("199")); // IP address m_vSftMaskIPAddr->Text = _bstr_t(_T("209.61.201.49")); // Password // you could set the font at design time too // this is to illustrate how to do it at run time IFontPtr pFont = m_vSftMaskPswd->GetFont(); pFont->put_Bold(TRUE); ISftMaskCaptionPtr pCapt = m_vSftMaskIPAddr->GetCaption(); pFont = pCapt->GetFont(); pFont->put_Italic(TRUE); return TRUE; // return TRUE unless you set the focus to a control } void CSample1Dlg::OnUpDownPressSftMaskAmount(BOOL Up, long FieldStart, long FieldEnd, long Counter, BSTR FAR* Field) { double Incr; if (Counter == 0 || Counter > 5) { wchar_t* endchar; double Val = wcstod(*Field, &endchar); Incr = 0.01; if (Counter > 14) Incr = 0.1; if (Counter > 23) Incr = 1.0; if (Counter > 52) Incr = 10.0; if (Up) Val += Incr; else Val -= Incr; if (Val > 99999.99) Val = 99999.99; if (Val < -99999.99) Val = -99999.99; wchar_t szBuffer[100]; swprintf(szBuffer, L"%#5.2f", Val); SysFreeString(*Field); *Field = SysAllocString(szBuffer); } } BEGIN_EVENTSINK_MAP(CSample1Dlg, CDialog) //{{AFX_EVENTSINK_MAP(CSample1Dlg) ON_EVENT(CSample1Dlg, IDC_SFTMASKAMOUNT, 29 /* UpDownPress */, OnUpDownPressSftMaskAmount, VTS_BOOL VTS_I4 VTS_I4 VTS_I4 VTS_PBSTR) //}}AFX_EVENTSINK_MAP END_EVENTSINK_MAP()