Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

SelText Property, SftMask Object

Defines the selected text.

Syntax

Get

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

Put

VB.NETobject.SelText = String As String
VBobject.SelText = String As String
C#.NETstring object.SelText = String;
VC++_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 retrieving the SelText property, the selected text is returned including all literals, as it is displayed.

When setting the SelText property, the specified Text replaces the currently selected text. Based on the ClipMode property, literals may be present. In any case, if characters in the new string Text are not acceptable based on the defined input mask (see Mask property), they are simply ignored. Languages that provide the HRESULT value can test for S_OK (the function was successful), S_FALSE (at least one character was ignored) or an error return value.

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

VB.NET

    AxSftMask1.OLEDropMode = SftMaskOLEDropModeConstants.OLEDropSftMaskManual
End Sub

Private Sub AxAxSftMask1_OLEDragDrop(ByVal sender As Object, ByVal e As AxSftMaskLib70._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 AxSftMaskLib70._ISftMaskEvents_OLEDragOverEvent) Handles AxSftMask1.OLEDragOver
    If e.targetChar < 0 Then

VB6

    SftMask1.OLEDropMode = OLEDropSftMaskManual
End Sub

Private Sub SftMask1_OLEDragDrop(Data As SftMaskLib70.DataObject, TargetChar As Long, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
    Dim S As String
    If Data.GetFormat(sftCFText) Then
        S = Data.GetData(sftCFText)
        SftMask1.SelStart = TargetChar
        SftMask1.SelText = S
    Else
        Effect = vbDropEffectNone
    End If
End Sub

Private Sub SftMask1_OLEDragOver(Data As SftMaskLib70.DataObject, TargetChar As Long, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single, State As SftMaskLib70.SftMaskOLEDragOverConstants)
    If TargetChar < 0 Then

C#

}

private void axSftMask1_OLEDragDrop(object sender, AxSftMaskLib70._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, AxSftMaskLib70._ISftMaskEvents_OLEDragOverEvent e)
{

C++

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 08/13/2020 - (email)
© 2024 Softel vdm, Inc.