HeaderPane
Main
Hide
Share Link
Print

SelText Property, SftMask Object

Defines the selected text.

Syntax

Get

C#string String = object.SelText;
VB.NETString = object.SelText As String
C++_bstr_t String = object->SelText;
_bstr_t String = object->GetSelText();
CHRESULT object->get_SelText(BSTR* String);

Put

C#string object.SelText = String;
VB.NETobject.SelText = String As String
C++_bstr_t object->SelText = String;
void object->PutSelText(_bstr_t String);
CHRESULT object->put_SelText(BSTR String);

object

A SftMask object.

String

Defines the selected text.

Comments

The SelText property defines the selected text.

The SelText property describes the currently selected text, including any literals based on the ClipMode property.

When setting the SelText property, the specified String replaces the currently selected text. Based on the ClipMode property, literals may be present. In any case, if characters in the new string String are not acceptable based on the defined input mask (see Mask property), they are simply ignored.

When retrieving or setting the SelText 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.

Examples

C# View entire sample code

}

private void axSftMask1_OLEDragDrop(object sender, AxSftMaskLib80._ISftMaskEvents_OLEDragDropEvent e)
{
    string s;
    if (e.data.GetFormat((short) SftOLEClipboardConstants.sftCFText)) {
        s = (string) e.data.GetData(SftOLEClipboardConstants.sftCFText);
        axSftMask1.SelStart = e.targetChar;
        axSftMask1.SelText = s;
    } else {
        e.effect = 0; //vbDropEffectNone
    }
}

private void axSftMask1_OLEDragOver(object sender, AxSftMaskLib80._ISftMaskEvents_OLEDragOverEvent e)
{

VB.NET View entire sample code

    AxSftMask1.OLEDropMode = SftMaskOLEDropModeConstants.OLEDropSftMaskManual
End Sub

Private Sub AxAxSftMask1_OLEDragDrop(ByVal sender As Object, ByVal e As AxSftMaskLib80._ISftMaskEvents_OLEDragDropEvent) Handles AxSftMask1.OLEDragDrop
    Dim S As String
    If e.data.GetFormat(SftOLEClipboardConstants.sftCFText) Then
        S = e.data.GetData(SftOLEClipboardConstants.sftCFText)
        AxSftMask1.SelStart = e.targetChar
        AxSftMask1.SelText = S
    Else
        e.effect = 0 ' vbDropEffectNone
    End If
End Sub

Private Sub AxAxSftMask1_OLEDragOver(ByVal sender As Object, ByVal e As AxSftMaskLib80._ISftMaskEvents_OLEDragOverEvent) Handles AxSftMask1.OLEDragOver
    If e.targetChar < 0 Then

C++ View entire sample code

void CProject1Dlg::OnOLEDragDropSftMask1(LPDISPATCH FAR* Data, long FAR* TargetChar, long FAR* Effect, short FAR* Button, short FAR* Shift, float FAR* x, float FAR* y)
{
    IVDMDataObjectPtr pData = *Data;

    if (pData->GetFormat(sftCFText) != VARIANT_FALSE) {
        _variant_t data = pData->GetData(_variant_t((long) sftCFText));
        data.ChangeType(VT_BSTR);
        m_pMask1->SelStart = *TargetChar;
        m_pMask1->SelText = data.bstrVal;
    } else
        *Effect = DROPEFFECT_NONE;
}

void CProject1Dlg::OnOLEDragOverSftMask1(LPDISPATCH FAR* Data, long FAR* TargetChar, long FAR* Effect, short FAR* Button, short FAR* Shift, float FAR* x, float FAR* y, long FAR* State)
{
    IVDMDataObjectPtr pData = *Data;

See Also SftMask Object | Object Hierarchy


Last Updated 11/15/2026 - (email)
© 2026 Softel vdm, Inc.