Click here to Skip to main content
15,879,326 members
Home / Discussions / C#
   

C#

 
QuestionReceive replies to a UDP broadcast Pin
Olivier Sannier4-Nov-08 23:39
Olivier Sannier4-Nov-08 23:39 
AnswerRe: Receive replies to a UDP broadcast Pin
Mark Salsbery5-Nov-08 5:22
Mark Salsbery5-Nov-08 5:22 
GeneralRe: Receive replies to a UDP broadcast Pin
Olivier Sannier5-Nov-08 22:28
Olivier Sannier5-Nov-08 22:28 
QuestionDrag and Drop TreeView Pin
Paul Unsworth4-Nov-08 23:36
Paul Unsworth4-Nov-08 23:36 
AnswerRe: Drag and Drop TreeView Pin
cyber-drugs5-Nov-08 0:22
cyber-drugs5-Nov-08 0:22 
GeneralRe: Drag and Drop TreeView Pin
Paul Unsworth5-Nov-08 0:53
Paul Unsworth5-Nov-08 0:53 
GeneralRe: Drag and Drop TreeView Pin
cyber-drugs5-Nov-08 1:04
cyber-drugs5-Nov-08 1:04 
GeneralRe: Drag and Drop TreeView [modified] Pin
DaveyM695-Nov-08 1:27
professionalDaveyM695-Nov-08 1:27 
This works for me Big Grin | :-D
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            treeView1.AllowDrop = true;
        }

        private void treeView1_DragDrop(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
                foreach (string file in files)
                {
                    // Do whatever you need here. file contains full path to folder or file
                }
            }
        }

        private void treeView1_DragOver(object sender, DragEventArgs e)
        {
            e.Effect = DragDropEffects.None;
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
                e.Effect = DragDropEffects.Copy;
        }
    }
}


[edit] I've read that this will sometimes not work under Vista (not got Vista here to try it) when debugging from the IDE. Build the exe and run independantly and it should be OK. [/edit]

Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

modified on Wednesday, November 5, 2008 7:36 AM

AnswerRe: Drag and Drop TreeView Pin
Paul Unsworth5-Nov-08 1:53
Paul Unsworth5-Nov-08 1:53 
QuestionHow to comunicate between two different appliaction/forms Pin
WinSolution4-Nov-08 22:47
WinSolution4-Nov-08 22:47 
AnswerRe: How to comunicate between two different appliaction/forms Pin
Giorgi Dalakishvili4-Nov-08 22:53
mentorGiorgi Dalakishvili4-Nov-08 22:53 
QuestionRe: How to comunicate between two different appliaction/forms Pin
WinSolution5-Nov-08 18:33
WinSolution5-Nov-08 18:33 
AnswerRe: How to comunicate between two different appliaction/forms Pin
Giorgi Dalakishvili5-Nov-08 19:25
mentorGiorgi Dalakishvili5-Nov-08 19:25 
AnswerRe: How to comunicate between two different appliaction/forms Pin
Giorgi Dalakishvili7-Nov-08 0:46
mentorGiorgi Dalakishvili7-Nov-08 0:46 
GeneralRe: How to comunicate between two different appliaction/forms Pin
WinSolution7-Nov-08 19:36
WinSolution7-Nov-08 19:36 
QuestionHow do I crop / convert an Image that has Indexed Pixel Format Pin
saberbladez4-Nov-08 22:26
saberbladez4-Nov-08 22:26 
GeneralRe: How do I crop / convert an Image that has Indexed Pixel Format Pin
cyber-drugs5-Nov-08 0:26
cyber-drugs5-Nov-08 0:26 
GeneralRe: How do I crop / convert an Image that has Indexed Pixel Format Pin
saberbladez5-Nov-08 14:32
saberbladez5-Nov-08 14:32 
QuestionTrimEnd? Pin
dec824-Nov-08 22:21
dec824-Nov-08 22:21 
AnswerRe: TrimEnd? Pin
Ashfield4-Nov-08 22:25
Ashfield4-Nov-08 22:25 
GeneralRe: TrimEnd? Pin
dec824-Nov-08 22:47
dec824-Nov-08 22:47 
AnswerRe: TrimEnd? Pin
Guffa5-Nov-08 2:53
Guffa5-Nov-08 2:53 
GeneralRe: TrimEnd? Pin
Guffa5-Nov-08 3:22
Guffa5-Nov-08 3:22 
AnswerRe: TrimEnd? Pin
Pedram Behroozi4-Nov-08 23:43
Pedram Behroozi4-Nov-08 23:43 
AnswerRe: TrimEnd? [modified] Pin
Guffa5-Nov-08 3:21
Guffa5-Nov-08 3:21 

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.