Hide

SftMask/OCX 7.0 - ActiveX Masked Edit Control

Display
Print

DragDrop1 Sample (C#)

This sample illustrates using an OLE drag source.

This is not an executable sample, so a complete project is not provided. These statements are intended to show basic concepts and the syntax used.

private void Form1_Load(object sender, System.EventArgs e)
{
    axSftMask1.Caption.SizePercent = 33;
    axSftMask1.Caption.Text = "&Filename:";
    axSftMask1.Mask = "";
    axSftMask1.MaxLength = 300;
    axSftMask1.PromptUnderline = false;
    axSftMask1.AutoComplete.Contents = SftMaskAutoCompleteContentsConstants.contentsSftMaskFilesDirs;
    axSftMask1.AutoComplete.DefaultDirectory = @"C:\";
    axSftMask1.OLEDragMode = SftMaskOLEDragModeConstants.OLEDragSftMaskManual;
}

private void axSftMask1_DragStarting(object sender, AxSftMaskLib70._ISftMaskEvents_DragStartingEvent e)
{
    if (axSftMask1.SelLength != 0) {
        axSftMask1.OLEDrag();
    }
}

private void axSftMask1_OLEStartDrag(object sender, AxSftMaskLib70._ISftMaskEvents_OLEStartDragEvent e)
{
    e.data.Clear();
    e.data.Files.Add(axSftMask1.SelText, null);
    e.data.SetData(null, SftOLEClipboardConstants.sftCFFiles);
    e.allowedEffects = 1; //vbDropEffectCopy
}

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