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 the control contents.
Get
VB.NET | String = object.Text As String |
VB | String = object.Text As String |
C#.NET | string String = object.Text; |
VC++ | _bstr_t String = object->Text; _bstr_t String = object->GetText(); |
C | HRESULT object->get_Text(BSTR* String); |
Put
VB.NET | object.Text = String As String |
VB | object.Text = String As String |
C#.NET | string object.Text = String; |
VC++ | _bstr_t object->Text = String; void object->PutText(_bstr_t String); |
C | HRESULT object->put_Text(BSTR String); |
object
String
Defines the control contents. A simple string or special symbolic values can be used. Symbols start with the = sign.
The Text property defines the control contents.
The DefaultText property can be used to define a default value for the Text property, when the Text property becomes empty.
When retrieving or setting the Text property in a Masked Edit control (with Mask), input positions without data are represented by the carriage return (Chr(13)) character. This allows the distinction between unspecified data and specified (but blank) data fields. A simple edit control (without Mask) does not have unspecified positions and never uses the carriage return place holder. The otherwise equivalent TextDisplay property returns space characters instead.
The ClipMode property affects the handling of literal characters.
It is possible to retrieve portions of the control contents using the Contents.Value property.
When assigning a string to the Text property, the following special symbolic values are allowed, which are replaced by their actual values:
Symbol | Value Used | Assigned To |
---|---|---|
=Today | Today's date and the current time | Contents.DateTime |
=Now | Today's date and the current time | Contents.DateTime |
=Yesterday | Yesterday's date and the current time | Contents.DateTime |
=Tomorrow | Tomorrow's date and the current time | Contents.DateTime |
Symbols are case sensitive and the leading = sign is required. When using symbolic values, no other characters can appear in the specified String argument.
The properties TextDisplay, TextDisplayWithLiterals, TextDisplayNoLiterals, TextPureWithLiterals and TextPureNoLiterals also retrieve the control contents with varying handling of unspecified input positions and literal characters.
Property | Unspecified Positions | Literals |
---|---|---|
Text | Chr(13) | ClipMode |
TextDisplay | Space | ClipMode |
TextDisplayNoLiterals | Space | No |
TextDisplayWithLiterals | Space | Yes |
TextPureNoLiterals | Chr(13) | No |
TextPureWithLiterals | Chr(13) | Yes |
Private Sub Command1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Command1.Click End End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 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 AxSftMaskLib70._ISftMaskEvents_UpDownPressEvent) Handles SftMaskAmount.UpDownPress
Option Explicit Private Sub Command1_Click() End End Sub Private Sub Form_Load() SftMaskPhone.Text = "9415058600" ' our phone number SftMaskPhone.SelStart = 1 ' set the input location SftMaskSSN.Text = "444-12-1111" ' a social security number SftMaskToday.Contents.DateTime = Date ' set today's date SftMaskTime.Contents.DateTime = Time SftMaskPercent.Contents.Value(0) = 50 ' start with 50 percent SftMaskAmount.Text = 199 SftMaskIPAddr.Text = "209.61.201.49" End Sub
private void Form1_Load(object sender, System.EventArgs e) { 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) { Application.Exit(); }
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();;
See Also SftMask Object | Object Hierarchy