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
Defines a field's contents.
Get
VB.NET | Val = object.Value(ByVal Index As Short) As Object |
VB | Val = object.Value(ByVal Index As Integer) As Variant |
C#.NET | object Val = object.get_Value(short Index); |
VC++ | _variant_t Val = object->Value[short Index]; _variant_t Val = object->GetValue(short Index); |
C | HRESULT object->get_Value(short Index, VARIANT* Val); |
Put
VB.NET | object.Value(ByVal Index As Short) = Val As Object |
VB | object.Value(ByVal Index As Integer) = Val As Variant |
C#.NET | void object.set_Value(short Index, object Val); |
VC++ | _variant_t object->Value[short Index] = Val; void object->PutValue(short Index, const _variant_t& Val); |
C | HRESULT object->put_Value(short Index, VARIANT Val); |
object
Index
The index of the variable as defined using the !number value token (see Mask property).
Val
A Variant defining the contents of the input positions or fields as defined using the !number value token (see Mask property).
The Value property defines a field's contents.
The Value property can be used to retrieve and set portions of a Masked Edit control's contents without knowing the exact position of the data. The Mask property is defined with the value token !number. Up to 10 value tokens can be used in a single mask.
When setting the Value property, the string defined using Val replaces the current contents of the portion of the mask defined by the matching value token. Based on the ClipMode property, literals may be present. In any case, if characters in the new string Val are not acceptable based on the defined input mask, they are simply ignored.
Date/time input fields can be retrieved and set using the Contents.DateTime property.
AxSftMask1.Mask = "(!0###!!) !1###!!\-!2####!!" AxSftMask1.Caption.Text = "&Phone Number: " AxSftMask1.Caption.SizePercent = 40 AxSftMask1.Caption.Alignment = SftMaskAlignConstants.alignSftMaskRight AxSftMask1.Caption.Position = SftMaskPositionConstants.positionSftMaskLeft AxSftMask1.Caption.VerticalAlignment = SftMaskVerticalAlignConstants.valignSftMaskBaseline AxSftMask1.AutoSize = True AxSftMask1.Text = "9415058600" MsgBox("The area code is " & AxSftMask1.Contents.Value(0)) MsgBox("The exchange is " & AxSftMask1.Contents.Value(1)) MsgBox("The last 4 digits are " & AxSftMask1.Contents.Value(2)) AxSftMask1.Contents.Value(2) = "8555" End Sub
SftMask1.Mask = "(!0###!!) !1###!!\-!2####!!" SftMask1.Caption.Text = "&Phone Number: " SftMask1.Caption.SizePercent = 40 SftMask1.Caption.Alignment = alignSftMaskRight SftMask1.Caption.Position = positionSftMaskLeft SftMask1.Caption.VerticalAlignment = valignSftMaskBaseline SftMask1.AutoSize = True SftMask1.Text = "9415058600" MsgBox ("The area code is " & SftMask1.Contents.Value(0)) MsgBox ("The exchange is " & SftMask1.Contents.Value(1)) MsgBox ("The last 4 digits are " & SftMask1.Contents.Value(2)) SftMask1.Contents.Value(2) = "8555" End Sub
axSftMask1.Mask = @"(!0###!!) !1###!!\-!2####!!"; axSftMask1.Caption.Text = "&Phone Number: "; axSftMask1.Caption.SizePercent = 40; axSftMask1.Caption.Alignment = SftMaskAlignConstants.alignSftMaskRight; axSftMask1.Caption.Position = SftMaskPositionConstants.positionSftMaskLeft; axSftMask1.Caption.VerticalAlignment = SftMaskVerticalAlignConstants.valignSftMaskBaseline; axSftMask1.AutoSize = true; axSftMask1.Text = "9415058600"; MessageBox.Show("The area code is " + axSftMask1.Contents.get_Value(0).ToString()); MessageBox.Show("The exchange is " + axSftMask1.Contents.get_Value(1).ToString()); MessageBox.Show("The last 4 digits are " + axSftMask1.Contents.get_Value(2).ToString()); axSftMask1.Contents.set_Value(2, "8555"); }
m_pMask1->Caption->Text = _T("&Phone Number: "); m_pMask1->Caption->SizePercent = 40; m_pMask1->Caption->Alignment = alignSftMaskRight; m_pMask1->Caption->Position = positionSftMaskLeft; m_pMask1->Caption->VerticalAlignment = valignSftMaskBaseline; m_pMask1->AutoSize = VARIANT_TRUE; m_pMask1->Text = _T("9415058600"); CString str; variant_t v = m_pMask1->Contents->Value[0]; v.ChangeType(VT_BSTR); str.Format(_T("The area code is %s"), CString(v.bstrVal)); AfxMessageBox(str); v = m_pMask1->Contents->Value[1]; v.ChangeType(VT_BSTR); str.Format(_T("The exchange is %s"), CString(v.bstrVal)); AfxMessageBox(str);
See Also SftMaskContents Object | Object Hierarchy