Autor Beitrag
SSC streezer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 110

WinXP, Vista Ultimate
C# (VS 05 n' 08), PHP
BeitragVerfasst: Do 01.10.09 07:02 
Hallo zusammen,

ich bin gerade daran ein "kleines" photo aufbereitungs tool zu entwickeln.
ich habe eine listview, in welche man seine bilder rein draggen kann. aber anscheinend kann man, z.b. vom desktop keine objekte in ein winform draggen.

Kann man das irgendwie umgehen? wie ermöglicht man den drag and drop vom desktop auf die winform?

für links, hinweise schon mal ein danke ;)


greets,
mike

_________________
>> Swiss Soldiers Clan << visit us
SSC streezer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 110

WinXP, Vista Ultimate
C# (VS 05 n' 08), PHP
BeitragVerfasst: Fr 02.10.09 07:04 
das problem ist ja, was soll gespeichert werden wenn ich ein objekt vom desktop (z.B.) in den listview einlese.
Ich hab mich jetzt einfach mal für den pfad entschieden.
Jedoch weiss ich nicht, ob ich die pfäde einfach in eine List speichern will / soll... ich hätte lieber eine ImageList gehabt...

weiss jemand wie das geht?

_________________
>> Swiss Soldiers Clan << visit us
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Fr 02.10.09 10:33 
user profile iconSSC streezer hat folgendes geschrieben Zum zitierten Posting springen:
das problem ist ja, was soll gespeichert werden wenn ich ein objekt vom desktop (z.B.) in den listview einlese.
Ich hab mich jetzt einfach mal für den pfad entschieden.
Jedoch weiss ich nicht, ob ich die pfäde einfach in eine List speichern will / soll... ich hätte lieber eine ImageList gehabt...

weiss jemand wie das geht?
Du sprichst in Rätseln :gruebel:

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
SSC streezer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 110

WinXP, Vista Ultimate
C# (VS 05 n' 08), PHP
BeitragVerfasst: Fr 02.10.09 10:36 
^^ habs inzwischen hingekriegt...

hier die Lösung:

ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
        private void listView1_DragDrop(object sender, DragEventArgs e)
        {
            // Handle FileDrop data
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
                foreach (string actfile in files)
                {
                    listView1.Items.Add(actfile);
                }
            }
            txtCountFiles.Text = "Anzahl Bilder: " + listView1.Items.Count ;
        }


ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
        private void listView1_DragEnter(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                e.Effect = DragDropEffects.Copy;
            }
            else
            {
                e.Effect = DragDropEffects.None;
            }
        }


Mein problem war ein Logikfehler der es verhinderte...

_________________
>> Swiss Soldiers Clan << visit us