Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

File Property, SftMaskAutoComplete Object

Defines the file used to store autocomplete entries.

Syntax

Get

VB.NETString = object.File As String
VBString = object.File As String
C#.NETstring String = object.File;
VC++_bstr_t String = object->File;
_bstr_t String = object->GetFile();
CHRESULT object->get_File(BSTR* String);

Put

VB.NETobject.File = String As String
VBobject.File = String As String
C#.NETstring object.File = String;
VC++_bstr_t object->File = String;
void object->PutFile(_bstr_t String);
CHRESULT object->put_File(BSTR String);

object

A SftMaskAutoComplete object.

String

A string defining the filename where autocomplete entries are stored, a full path or a partial path with leading "-" character (see below). To disable the autocomplete feature specify an empty or null string.

Comments

The File property defines the file used to store autocomplete entries.

This property is required when the AutoComplete.Contents property is set to contentsSftMaskText. If the File property is assigned an empty or null string, the autocomplete feature is not available.

If the AutoComplete.Contents property is set to contentsSftMaskFiles, contentsSftMaskDirs or contentsSftMaskFilesDirs, the File property can be assigned an empty or null string, as file/directory lists or selections are never saved. If the File property is specified, the height and width of the autocomplete window is saved so it can be restored later.

Each Masked Edit control should use a unique file name to store autocomplete entries.

Saved autocomplete entries are stored in the file defined by the File property. The String argument should specify a full path, not just a file name.

If the String argument starts with a "-" character, the remainder (excluding the "-" character) is appended to the system defined application data folder. This folder is generally named "Documents and Settings\username\Application Data", which is usually a hidden folder. This folder name can be obtained using the Windows API SHGetFolderPath CSIDL_APPDATA.

The File property can define a full path (explicitly or by using the "-" character). Any subdirectories that are specified are automatically created if they do not exist.

When using the leading "-" character, it is recommended to use an initial subdirectory name, uniquely identifying the application or the company name, in order to avoid any accidental naming conflict.

Examples

VB.NET

    AutoCompleteObj = AxSftMask1.AutoComplete

    CaptionObj.SizePercent = 33
    CaptionObj.Text = "&ZIP Code:"

    AxSftMask1.Mask = "#####"
    AxSftMask1.EntrySelect = SftMaskEntrySelectConstants.entrySftMaskSelectEndHome

    AutoCompleteObj.File = "-\Softelvdm\AutoComplete\SampleFile2.Suggest"
    AutoCompleteObj.Encrypt = False
    AutoCompleteObj.IgnoreCase = True
    AutoCompleteObj.MaxEntries = 50
    AutoCompleteObj.Mode = SftMaskAutoCompleteModeConstants.autocompleteSftMaskSuggest
End Sub

Private Sub AxSftMask1_MatchAddCustomItems(ByVal sender As Object, ByVal e As AxSftMaskLib70._ISftMaskEvents_MatchAddCustomItemsEvent) Handles AxSftMask1.MatchAddCustomItems

VB6

    Set AutoCompleteObj = SftMask1.AutoComplete

    CaptionObj.SizePercent = 33
    CaptionObj.Text = "&ZIP Code:"

    SftMask1.Mask = "#####"
    SftMask1.EntrySelect = entrySftMaskSelectEndHome

    AutoCompleteObj.File = "-\Softelvdm\AutoComplete\SampleFile2.Suggest"
    AutoCompleteObj.Encrypt = False
    AutoCompleteObj.IgnoreCase = True
    AutoCompleteObj.MaxEntries = 50
    AutoCompleteObj.Mode = autocompleteSftMaskSuggest
End Sub

Private Sub SftMask1_MatchAddCustomItems(ByVal Count As Long)

C#

    AutoCompleteObj = axSftMask1.AutoComplete;

    CaptionObj.SizePercent = 33;
    CaptionObj.Text = "&ZIP Code:";

    axSftMask1.Mask = "#####";
    axSftMask1.EntrySelect = SftMaskEntrySelectConstants.entrySftMaskSelectEndHome;

    AutoCompleteObj.File = @"-\Softelvdm\AutoComplete\SampleFile2.Suggest";
    AutoCompleteObj.Encrypt = false;
    AutoCompleteObj.IgnoreCase = true;
    AutoCompleteObj.MaxEntries = 50;
    AutoCompleteObj.Mode = SftMaskAutoCompleteModeConstants.autocompleteSftMaskSuggest;
}

private void axSftMask1_MatchAddCustomItems(object sender, AxSftMaskLib70._ISftMaskEvents_MatchAddCustomItemsEvent e)

C++

    pCaption = m_pMask1->Caption;

    pCaption->SizePercent = 33;
    pCaption->Text = _T("&ZIP Code:");

    m_pMask1->Mask = _T("#####");
    m_pMask1->EntrySelect = entrySftMaskSelectEndHome;

    pAutoComplete->File = _T("-\\Softelvdm\\AutoComplete\\SampleFile2.Suggest");
    pAutoComplete->Encrypt = VARIANT_FALSE;
    pAutoComplete->IgnoreCase = VARIANT_TRUE;
    pAutoComplete->MaxEntries = 50;
    pAutoComplete->Mode = autocompleteSftMaskSuggest;

    return TRUE;
}

See Also SftMaskAutoComplete Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.