Defines the year where a higher 2-digit year indicates the previous century.
Get
| C# | int Year = object.CenturyBreak; |
| VB.NET | Year = object.CenturyBreak As Integer |
| C++ | long Year = object->CenturyBreak; long Year = object->GetCenturyBreak(); |
| C | HRESULT object->get_CenturyBreak(long* Year); |
Put
| C# | int object.CenturyBreak = Year; |
| VB.NET | object.CenturyBreak = Year As Integer |
| C++ | long object->CenturyBreak = Year; void object->PutCenturyBreak(long Year); |
| C | HRESULT object->put_CenturyBreak(long Year); |
object
Year
Defines the year where a higher 2-digit year indicates the previous century. This value is between -1 and 99. If -1 is specified, the break is derived from the current date: 2-digit years greater than the start of the current decade plus 30 are assumed to be in the prior century (for example, 51 through 99 in the year 2026).
The CenturyBreak property defines the year where a higher 2-digit year indicates the previous century.
This value is used when a date without century is entered (i.e., a two digit year). The correct century is determined based on the CenturyBreak property. Any two digit year greater than or equal to the CenturyBreak value is assumed to be in the prior century.
private void Form1_Load(object sender, System.EventArgs e)
{
axSftMask1.Mask = "$d";
axSftMask1.Calendar.CenturyBreak = 50;
// 00-49 is 20xx 50-99 is 19xx
axSftMask1.Alignment = SftMaskAlignConstants.alignSftMaskRight;
axSftMask1.EditStyle = SftMaskEditStyleConstants.editSftMaskCalendarDropDown;
axSftMask1.AutoAdvance = true;
axSftMask1.TabAdvance = true;
axSftMask1.Caption.Text = "&Ship Date";
axSftMask1.Caption.Alignment = SftMaskAlignConstants.alignSftMaskCenter;
axSftMask1.Caption.Position = SftMaskPositionConstants.positionSftMaskTop;
axSftMask1.Contents.DateTime = new DateTime(2007, 1, 1);
axSftMask1.Caption.BackColor = (uint) ColorTranslator.ToOle(SystemColors.Highlight);
axSftMask1.Caption.ForeColor = (uint) ColorTranslator.ToOle(SystemColors.HighlightText);
axSftMask1.AutoSize = true;Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load AxSftMask1.Mask = "$d" AxSftMask1.Calendar.CenturyBreak = 50 ' 00-49 is 20xx 50-99 is 19xx AxSftMask1.Alignment = SftMaskAlignConstants.alignSftMaskRight AxSftMask1.EditStyle = SftMaskEditStyleConstants.editSftMaskCalendarDropDown AxSftMask1.AutoAdvance = True AxSftMask1.TabAdvance = True AxSftMask1.Caption.Text = "&Ship Date" AxSftMask1.Caption.Alignment = SftMaskAlignConstants.alignSftMaskCenter AxSftMask1.Caption.Position = SftMaskPositionConstants.positionSftMaskTop AxSftMask1.Contents.DateTime = #1/1/2007# AxSftMask1.Caption.BackColor = Convert.ToUInt32(ColorTranslator.ToOle(SystemColors.Highlight) And &HFFFFFFFF&) AxSftMask1.Caption.ForeColor = Convert.ToUInt32(ColorTranslator.ToOle(SystemColors.HighlightText) And &HFFFFFFFF&) AxSftMask1.AutoSize = True End Sub
BOOL CProject1Dlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_pMask1 = m_Mask1.GetControlUnknown();
_ASSERT(m_pMask1 != NULL);
m_pMask1->Mask = _T("$d");
m_pMask1->Calendar->CenturyBreak = 50;
// 00-49 is 20xx 50-99 is 19xx
m_pMask1->Alignment = alignSftMaskRight;
m_pMask1->EditStyle = editSftMaskCalendarDropDown;
m_pMask1->AutoAdvance = VARIANT_TRUE;
m_pMask1->TabAdvance = VARIANT_TRUE;
m_pMask1->Caption->Text = _T("&Ship Date");
m_pMask1->Caption->Alignment = alignSftMaskCenter;See Also SftMaskCalendar Object | Object Hierarchy