Click here to Skip to main content
15,896,557 members
Home / Discussions / C#
   

C#

 
AnswerRe: Help please, I have a error in this script, when I follow the suggestion their are more errors Pin
OriginalGriff29-Apr-16 5:03
mveOriginalGriff29-Apr-16 5:03 
GeneralRe: Help please, I have a error in this script, when I follow the suggestion their are more errors Pin
Pete O'Hanlon29-Apr-16 7:42
mvePete O'Hanlon29-Apr-16 7:42 
QuestionI add table into Control dataSet of XtraReport ? Pin
Member 245846728-Apr-16 20:57
Member 245846728-Apr-16 20:57 
AnswerRe: I add table into Control dataSet of XtraReport ? Pin
Gerry Schmitz29-Apr-16 6:45
mveGerry Schmitz29-Apr-16 6:45 
AnswerRe: I add table into Control dataSet of XtraReport ? Pin
Eddy Vluggen29-Apr-16 6:47
professionalEddy Vluggen29-Apr-16 6:47 
AnswerRe: I add table into Control dataSet of XtraReport ? Pin
Marco Bertschi3-May-16 21:30
protectorMarco Bertschi3-May-16 21:30 
Questionwhat do you know the name of this control ? Pin
Member 245846728-Apr-16 20:37
Member 245846728-Apr-16 20:37 
AnswerRe: what do you know the name of this control ? Pin
Pete O'Hanlon28-Apr-16 23:42
mvePete O'Hanlon28-Apr-16 23:42 
QuestionSerializing a ResourceDictionary to binary and back Pin
Imagiv28-Apr-16 8:25
Imagiv28-Apr-16 8:25 
AnswerRe: Serializing a ResourceDictionary to binary and back Pin
Matt T Heffron28-Apr-16 14:48
professionalMatt T Heffron28-Apr-16 14:48 
GeneralRe: Serializing a ResourceDictionary to binary and back Pin
Imagiv28-Apr-16 15:39
Imagiv28-Apr-16 15:39 
QuestionIs it possible to read all probe response coming to a certain access point Pin
mohammed qaid28-Apr-16 7:31
mohammed qaid28-Apr-16 7:31 
Question[SOLVED] Drag and drop file explorer Pin
AndrewRue28-Apr-16 2:47
professionalAndrewRue28-Apr-16 2:47 
AnswerRe: Drag and drop file explorer Pin
OriginalGriff28-Apr-16 3:02
mveOriginalGriff28-Apr-16 3:02 
GeneralRe: Drag and drop file explorer Pin
AndrewRue28-Apr-16 3:11
professionalAndrewRue28-Apr-16 3:11 
GeneralRe: Drag and drop file explorer Pin
OriginalGriff28-Apr-16 3:26
mveOriginalGriff28-Apr-16 3:26 
GeneralRe: Drag and drop file explorer Pin
AndrewRue28-Apr-16 19:50
professionalAndrewRue28-Apr-16 19:50 
GeneralRe: Drag and drop file explorer Pin
OriginalGriff28-Apr-16 20:54
mveOriginalGriff28-Apr-16 20:54 
That would be because you aren't dragging them out of your listview as files - you are setting text format instead.
If you use the DataFormats.FileDrop Field (System.Windows)[^] it will allow you to drag them from your list box into anything which accepts files (inclding Explorer, Chrome, Word, ...)
It's not difficult!
Handle the MouseDown event for your ListView (this uses a DataGridView because I had one handy with files in a current project, and uses the right mouse button so I don't muck up my other code!)
C#
private void myDataGridView_MouseDown(object sender, MouseEventArgs e)
    {
    if (e.Button == MouseButtons.Right)
        {
        List<string> files = new List<string>();
        foreach (DataGridViewRow row in myDataGridView.Rows)
            {
            files.Add((string)row.Cells["Location"].Value);
            }
        string[] selectedFiles = files.ToArray();
        // Load files as multiple types: Files (all) and Text (first one only)
        DataObject dragData = new DataObject(DataFormats.FileDrop, selectedFiles);
        dragData.SetData(DataFormats.StringFormat, selectedFiles[0]);
        DoDragDrop(dragData, DragDropEffects.Copy | DragDropEffects.Move);
        }
    }

That sets the list of files into the drag as files - you can now drop them on anything that accepts files!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

GeneralRe: Drag and drop file explorer Pin
AndrewRue28-Apr-16 21:27
professionalAndrewRue28-Apr-16 21:27 
GeneralRe: Drag and drop file explorer Pin
OriginalGriff28-Apr-16 22:44
mveOriginalGriff28-Apr-16 22:44 
QuestionShouldnt this work? Pin
David Reeves27-Apr-16 12:25
David Reeves27-Apr-16 12:25 
AnswerRe: Shouldnt this work? Pin
Dave Kreskowiak27-Apr-16 13:54
mveDave Kreskowiak27-Apr-16 13:54 
AnswerRe: Shouldnt this work? Pin
Brisingr Aerowing27-Apr-16 14:21
professionalBrisingr Aerowing27-Apr-16 14:21 
GeneralRe: Shouldnt this work? Pin
David Reeves27-Apr-16 14:40
David Reeves27-Apr-16 14:40 
GeneralRe: Shouldnt this work? Pin
Philippe Mori27-Apr-16 15:57
Philippe Mori27-Apr-16 15:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.