Returns a collection of filenames used by the sftCFFiles format.
Get
| C# | DataObjectFiles Files = object.Files; |
| VB.NET | Files = object.Files As DataObjectFiles |
| C++ | IVDMDataObjectFiles* Files = object->Files; IVDMDataObjectFiles* Files = object->GetFiles(); |
| C | HRESULT object->get_Files(struct IVDMDataObjectFiles** Files); |
object
Files
Returns a collection of filenames used by the sftCFFiles format.
The Files property returns a collection of filenames used by the sftCFFiles format.
The Files collection is filled with file names only when the DataObject object contains data of type sftCFFiles. The DataObject object can contain several different types of data. You can iterate through the Item property to retrieve the list of file names.
The Files collection can be filled to allow an application to act as a drag source for a list of files (similar to Windows Explorer).
int itemIndex = comboTarget.Items.Insert("A Bitmap", comboTarget.Items.DropIndex);
object o = e.data.GetData(SftOLEClipboardConstants.sftCFBitmap);
comboTarget.get_Item(itemIndex).Image.Picture = o as stdole.IPictureDisp;
comboTarget.Items.Selection = itemIndex;
}
if (e.data.GetFormat((short) SftOLEClipboardConstants.sftCFFiles)) {
int itemIndex = -1;
int toIndex = comboTarget.Items.DropIndex;
foreach (string s in e.data.Files) {
itemIndex = comboTarget.Items.Insert(s, toIndex);
toIndex = toIndex + 1;
}
comboTarget.Items.Selection = itemIndex;
}
comboTarget.Columns.MakeOptimal(0);
comboTarget.Items.RecalcHorizontalExtent(0);
Dim o As Object = e.data.GetData(SftOLEClipboardConstants.sftCFBitmap)
comboTarget.get_Item(itemIndex).Image.Picture = o 'as stdole.IPictureDisp
comboTarget.Items.Selection = itemIndex
End If
If e.data.GetFormat(SftOLEClipboardConstants.sftCFFiles) Then
Dim itemIndex As Integer = -1
Dim toIndex As Integer = comboTarget.Items.DropIndex
Dim s As String
For Each s In e.data.Files
itemIndex = comboTarget.Items.Insert(s, toIndex)
toIndex = toIndex + 1
Next
comboTarget.Items.Selection = itemIndex
End If
comboTarget.Columns.MakeOptimal(0)
comboTarget.Items.RecalcHorizontalExtent(0)See Also DataObject Object | Object Hierarchy