Drag and Drop, source is from app or file explorer? - winforms

I have a winform app which allows drag and drop. In the app is a fileListView which is a mock up of a file explorer.
I can currently drag a file from the fileListView or the file explorer.
How can I tell if the drag source is from the fileListView or from the file explorer?
I was using the e.Data.GetData(DataFormats.FileDrop) and seeing if the substring started with '\'. However, I've since learned that this isn't good enough because sometimes the file explorer can drag files directories starting with '\' also.
note: all the files on the fileListView start with '\'

Related

electron-react-boilerplate) How to create file download system using drag and drop

I'm creating file converter using electron-react-boilerplate. Although importing files was implemented with drag and drop, did not implement downloading files by drag and drop like when dragging a Google image search result.
https://www.electronjs.org/docs/latest/tutorial/native-file-drag-drop
I tried the above method, but it didn't work in electron-react-boilerplate environment.
Is there a way to get files in a specific path by drag and drop in the app?

How to open PDF in Pixelsense application

I'm working on an application for Pixelsense using Microsoft surface 2.0 , I wants to open PDF file in my application in scatterview control , so that i can zoom , rotate & move my PDF file . I have followed the process given http://hugeonion.com/2009/04/06/displaying-a-pdf-file-within-a-wpf-application/
In the link i'm able to open PDF file in scatterview but not able to rotate & zoom it
I would suggest conmverting your PDF file to an image or images, then using those. It may be that ScatterView doesnt have all the support for embeded activeX controls etc and has better support for images.
Processing PDF files can be done with GhostScript (open source) or commercial PDF components.

Silverlight Download a Project File

I have a series of Files (word, pdf, ect) that are stored in my application and the idea is to allow the end user to download these files at their choosing. How is this done in silverlight? I tried using a SaveFileDialog but I must not be doing it correctly. Thanks!

How do I load a folder of images on a visual c++ windows form application

I have a visual c++ windows form application (empty) made on visual studio 2008
I would like to add a button so users can browse a folder.
after they select the folder I would like to "scan" that folder and list all the images (JPG, PNG and GIF) in my windows form application.
can anyone provide me with the steps required ?
Thank you
I am not sure if there is any automatic way to scan image files but since you have only 3 extensions, you could try the following per extension,
string[] imageList = Directory.GetFiles(path, "*.jpg");
where path is the folder you browse to using the browse folder dialog (NOT the browse file dialog).
It returns a string of all the files in the directory along with their full paths. Optionally you can trim of the path using a simple .Split('\') command.
I'm not sure if the string[] will work in C++ as the syntax seems to want the hat symbol, as seen below.
array<String^>^imageList
Here is the link for the getfiles method.

Can we drop a file in windows explorer from WPF window?

I have a treeview that shows the current file system. I want to add functionality to enable dropping files into windows explorer. If I drag any of the node of my treeview and drop it on any of the window of Windows explorer then the file will be copied to that location. How can I accomplish this?
First read this about how to implement drag and drop in WPF.
The read this for some information about what explorer expects when you drop in it.
Then ask new questions if you still have any.

Resources