Defines the date and time field contents.
Get
| C# | System.DateTime Dt = object.DateTime; |
| VB.NET | Dt = object.DateTime As Date |
| C++ | DATE Dt = object->DateTime; DATE Dt = object->GetDateTime(); |
| C | HRESULT object->get_DateTime(DATE* Dt); |
Put
| C# | System.DateTime object.DateTime = Dt; |
| VB.NET | object.DateTime = Dt As Date |
| C++ | DATE object->DateTime = Dt; void object->PutDateTime(DATE Dt); |
| C | HRESULT object->put_DateTime(DATE Dt); |
object
Dt
A Date value defining all date and time related fields of the defined mask (see Mask property).
The DateTime property defines the date and time field contents.
The DateTime property can be used to retrieve and set portions of a Masked Edit control's contents without knowing the exact position of the data. All date and time related fields of the mask are affected.
When setting the DateTime property, the date defined using Dt replaces the current contents of any date and time related fields of the mask.
Other portions of the mask can be retrieved and set using the Contents.Value property.
mask.DarkMode = SftMaskLib80.SftMaskDarkModeConstants.darkSftMaskAuto; // follow the Windows dark mode setting
mask.HighContrastMode = SftMaskLib80.SftMaskHighContrastConstants.highContrastSftMaskAuto; // follow the Windows High Contrast setting
}
}
SftMaskPhone.Text = "9415058600"; // our phone number
SftMaskPhone.EntrySelect = SftMaskEntrySelectConstants.entrySftMaskSelectHome; // set the input location
SftMaskSSN.Text = "444-12-1111"; // a social security number
SftMaskToday.Contents.DateTime = System.DateTime.Now; // set today's date
SftMaskTime.Contents.DateTime = System.DateTime.Now;
SftMaskPercent.Contents.set_Value(0, 50); // start with 50 percent
SftMaskAmount.Text = "199";
SftMaskIPAddr.Text = "209.61.201.49";
}
private void Command1_Click(object sender, System.EventArgs e)
mask.DarkMode = SftMaskLib80.SftMaskDarkModeConstants.darkSftMaskAuto ' follow the Windows dark mode setting
mask.HighContrastMode = SftMaskLib80.SftMaskHighContrastConstants.highContrastSftMaskAuto ' follow the Windows High Contrast setting
End If
Next
SftMaskPhone.Text = "9415058600" ' our phone number
SftMaskPhone.EntrySelect = SftMaskEntrySelectConstants.entrySftMaskSelectHome ' set the input location
SftMaskSSN.Text = "444-12-1111" ' a social security number
SftMaskToday.Contents.DateTime = Today ' set today's date
SftMaskTime.Contents.DateTime = TimeOfDay
SftMaskPercent.Contents.Value(0) = 50 ' start with 50 percent
SftMaskAmount.Text = CStr(199)
SftMaskIPAddr.Text = "209.61.201.49"
End Sub
Private Sub SftMaskAmount_UpDownPress(ByVal sender As Object, ByVal e As AxSftMaskLib80._ISftMaskEvents_UpDownPressEvent) Handles SftMaskAmount.UpDownPress
// 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);
See Also SftMaskContents Object | Object Hierarchy