473,749 Members | 2,432 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DragDrop Question

Hi All,

My question is on DragDrop,

How would I implement a Drag from listview and Drop on Desktop or any other
folder on the computer.

The listview contains list of files, so basically I should be able to drop
those files on other folders in my computer.

I hope that's possible in .net 2.0

Thanks

Ratnesh
Apr 6 '07 #1
10 1263
bump

if anybody knows the answer

"Ratnesh Raval" <ra**********@g mail.comwrote in message
news:eF******** ******@TK2MSFTN GP04.phx.gbl...
Hi All,

My question is on DragDrop,

How would I implement a Drag from listview and Drop on Desktop or any
other folder on the computer.

The listview contains list of files, so basically I should be able to drop
those files on other folders in my computer.

I hope that's possible in .net 2.0

Thanks

Ratnesh


Apr 18 '07 #2

"Ratnesh Raval" <ra**********@g mail.comwrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
bump

if anybody knows the answer

"Ratnesh Raval" <ra**********@g mail.comwrote in message
news:eF******** ******@TK2MSFTN GP04.phx.gbl...
>Hi All,

My question is on DragDrop,

How would I implement a Drag from listview and Drop on Desktop or any
other folder on the computer.

The listview contains list of files, so basically I should be able to
drop those files on other folders in my computer.

I hope that's possible in .net 2.0

Thanks

Ratnesh


Ratnesh,

I am at work right now so I don't have access to my home PC. I do have a
sample of drag and drop of files. It is quite simple but I will post a
little of the code when I get home.

LS

Apr 19 '07 #3

"Lloyd Sheen" <a@b.cwrote in message
news:8A******** *************** ***********@mic rosoft.com...
>
"Ratnesh Raval" <ra**********@g mail.comwrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>bump

if anybody knows the answer

"Ratnesh Raval" <ra**********@g mail.comwrote in message
news:eF******* *******@TK2MSFT NGP04.phx.gbl.. .
>>Hi All,

My question is on DragDrop,

How would I implement a Drag from listview and Drop on Desktop or any
other folder on the computer.

The listview contains list of files, so basically I should be able to
drop those files on other folders in my computer.

I hope that's possible in .net 2.0

Thanks

Ratnesh



Ratnesh,

I am at work right now so I don't have access to my home PC. I do have a
sample of drag and drop of files. It is quite simple but I will post a
little of the code when I get home.

LS
Ratnesh,

Here is some sample code:

The following are variables used for the D&D processsing of mouse moves.

Private _MouseDown As Boolean = False
Private _MouseX As Integer
Private _MouseY As Integer
Private _MouseButtons As MouseButtons
Private _SwitchContext As Boolean = False

The following happens when the mouse button is pressed over my listview

Private Sub List_MouseDown( ByVal sender As System.Object, ByVal e As
System.Windows. Forms.MouseEven tArgs) Handles SongFileView.Mo useDown
_MouseButtons = e.Button
_SwitchContext = False
_MouseDown = True
_MouseX = e.X
_MouseY = e.Y
End Sub

The following happens on a move of the mouse. I use a test for the distance
the mouse has moved to prevent false drag drop operations:

Private Sub List_MouseMove( ByVal sender As System.Object, ByVal e As
System.Windows. Forms.MouseEven tArgs) Handles SongFileView.Mo useMove
Dim lv As ListView = DirectCast(send er, ListView)
Dim sc As New StringCollectio n

If _MouseDown Then
If Math.Abs(_Mouse X - e.X) < 5 Or Math.Abs(_Mouse Y - e.Y) < 5
Then
Exit Sub
End If
Dim xx As DataObject = New DataObject
Dim yy As ArrayList = New ArrayList
For Each idx As Integer In lv.SelectedIndi ces
Dim li As ListViewItem = lv.Items(idx)
yy.Add(li.SubIt ems(5).Text + "\" + li.Text)
sc.Add(li.SubIt ems(5).Text + "\" + li.Text)
Next

Dim zz As Array = yy.ToArray
xx.SetFileDropL ist(sc)
xx.SetData("Lis tItems", lv.SelectedItem s)
Try
lv.DoDragDrop(x x, DragDropEffects .Copy)
_MouseDown = False
Catch ex As Exception
Dim zzzz As Integer = 1
End Try

End If
End Sub

The following will reset the D&D if the mouse button is release over the
listview:

Private Sub SongFileView_Mo useUp(ByVal sender As System.Object, ByVal e
As System.Windows. Forms.MouseEven tArgs) Handles SongFileView.Mo useUp
_MouseDown = False
End Sub
Hope this helps:

Lloyd Sheen

Apr 19 '07 #4

"Lloyd Sheen" <a@b.cwrote in message
news:06******** *************** ***********@mic rosoft.com...
>
"Lloyd Sheen" <a@b.cwrote in message
news:8A******** *************** ***********@mic rosoft.com...
>>
"Ratnesh Raval" <ra**********@g mail.comwrote in message
news:%2******* *********@TK2MS FTNGP06.phx.gbl ...
>>bump

if anybody knows the answer

"Ratnesh Raval" <ra**********@g mail.comwrote in message
news:eF****** ********@TK2MSF TNGP04.phx.gbl. ..
Hi All,

My question is on DragDrop,

How would I implement a Drag from listview and Drop on Desktop or any
other folder on the computer.

The listview contains list of files, so basically I should be able to
drop those files on other folders in my computer.

I hope that's possible in .net 2.0

Thanks

Ratnesh


Ratnesh,

I am at work right now so I don't have access to my home PC. I do have
a sample of drag and drop of files. It is quite simple but I will post
a little of the code when I get home.

LS
Ratnesh,

Here is some sample code:

The following are variables used for the D&D processsing of mouse moves.

Private _MouseDown As Boolean = False
Private _MouseX As Integer
Private _MouseY As Integer
Private _MouseButtons As MouseButtons
Private _SwitchContext As Boolean = False

The following happens when the mouse button is pressed over my listview

Private Sub List_MouseDown( ByVal sender As System.Object, ByVal e As
System.Windows. Forms.MouseEven tArgs) Handles SongFileView.Mo useDown
_MouseButtons = e.Button
_SwitchContext = False
_MouseDown = True
_MouseX = e.X
_MouseY = e.Y
End Sub

The following happens on a move of the mouse. I use a test for the
distance the mouse has moved to prevent false drag drop operations:

Private Sub List_MouseMove( ByVal sender As System.Object, ByVal e As
System.Windows. Forms.MouseEven tArgs) Handles SongFileView.Mo useMove
Dim lv As ListView = DirectCast(send er, ListView)
Dim sc As New StringCollectio n

If _MouseDown Then
If Math.Abs(_Mouse X - e.X) < 5 Or Math.Abs(_Mouse Y - e.Y) < 5
Then
Exit Sub
End If
Dim xx As DataObject = New DataObject
Dim yy As ArrayList = New ArrayList
For Each idx As Integer In lv.SelectedIndi ces
Dim li As ListViewItem = lv.Items(idx)
yy.Add(li.SubIt ems(5).Text + "\" + li.Text)
sc.Add(li.SubIt ems(5).Text + "\" + li.Text)
Next

Dim zz As Array = yy.ToArray
xx.SetFileDropL ist(sc)
xx.SetData("Lis tItems", lv.SelectedItem s)
Try
lv.DoDragDrop(x x, DragDropEffects .Copy)
_MouseDown = False
Catch ex As Exception
Dim zzzz As Integer = 1
End Try

End If
End Sub

The following will reset the D&D if the mouse button is release over the
listview:

Private Sub SongFileView_Mo useUp(ByVal sender As System.Object, ByVal
e As System.Windows. Forms.MouseEven tArgs) Handles SongFileView.Mo useUp
_MouseDown = False
End Sub
Hope this helps:

Lloyd Sheen
Well, it helped *me*! Thanks!

Robin S.
Apr 20 '07 #5
Hey Lloyd Sheen,

Thanks for the help, that code really works.

But I am still getting some problem. Because I am trying to implement a
listview, in which
1. I am dragging files from explorer and droping in it,
2. Dragging files inside listview to another folder,
3. Dragging files from listview and dropping in windows explorer.

and trying to make everything work is giving problems

Thnx for your snippet.

R
"Lloyd Sheen" <a@b.cwrote in message
news:06******** *************** ***********@mic rosoft.com...
>
"Lloyd Sheen" <a@b.cwrote in message
news:8A******** *************** ***********@mic rosoft.com...
>>
"Ratnesh Raval" <ra**********@g mail.comwrote in message
news:%2******* *********@TK2MS FTNGP06.phx.gbl ...
>>bump

if anybody knows the answer

"Ratnesh Raval" <ra**********@g mail.comwrote in message
news:eF****** ********@TK2MSF TNGP04.phx.gbl. ..
Hi All,

My question is on DragDrop,

How would I implement a Drag from listview and Drop on Desktop or any
other folder on the computer.

The listview contains list of files, so basically I should be able to
drop those files on other folders in my computer.

I hope that's possible in .net 2.0

Thanks

Ratnesh


Ratnesh,

I am at work right now so I don't have access to my home PC. I do have a
sample of drag and drop of files. It is quite simple but I will post a
little of the code when I get home.

LS
Ratnesh,

Here is some sample code:

The following are variables used for the D&D processsing of mouse moves.

Private _MouseDown As Boolean = False
Private _MouseX As Integer
Private _MouseY As Integer
Private _MouseButtons As MouseButtons
Private _SwitchContext As Boolean = False

The following happens when the mouse button is pressed over my listview

Private Sub List_MouseDown( ByVal sender As System.Object, ByVal e As
System.Windows. Forms.MouseEven tArgs) Handles SongFileView.Mo useDown
_MouseButtons = e.Button
_SwitchContext = False
_MouseDown = True
_MouseX = e.X
_MouseY = e.Y
End Sub

The following happens on a move of the mouse. I use a test for the
distance the mouse has moved to prevent false drag drop operations:

Private Sub List_MouseMove( ByVal sender As System.Object, ByVal e As
System.Windows. Forms.MouseEven tArgs) Handles SongFileView.Mo useMove
Dim lv As ListView = DirectCast(send er, ListView)
Dim sc As New StringCollectio n

If _MouseDown Then
If Math.Abs(_Mouse X - e.X) < 5 Or Math.Abs(_Mouse Y - e.Y) < 5
Then
Exit Sub
End If
Dim xx As DataObject = New DataObject
Dim yy As ArrayList = New ArrayList
For Each idx As Integer In lv.SelectedIndi ces
Dim li As ListViewItem = lv.Items(idx)
yy.Add(li.SubIt ems(5).Text + "\" + li.Text)
sc.Add(li.SubIt ems(5).Text + "\" + li.Text)
Next

Dim zz As Array = yy.ToArray
xx.SetFileDropL ist(sc)
xx.SetData("Lis tItems", lv.SelectedItem s)
Try
lv.DoDragDrop(x x, DragDropEffects .Copy)
_MouseDown = False
Catch ex As Exception
Dim zzzz As Integer = 1
End Try

End If
End Sub

The following will reset the D&D if the mouse button is release over the
listview:

Private Sub SongFileView_Mo useUp(ByVal sender As System.Object, ByVal e
As System.Windows. Forms.MouseEven tArgs) Handles SongFileView.Mo useUp
_MouseDown = False
End Sub
Hope this helps:

Lloyd Sheen

Apr 23 '07 #6

"Ratnesh Raval" <ra**********@g mail.comwrote in message
news:uS******** ******@TK2MSFTN GP04.phx.gbl...
Hey Lloyd Sheen,

Thanks for the help, that code really works.

But I am still getting some problem. Because I am trying to implement a
listview, in which
1. I am dragging files from explorer and droping in it,
2. Dragging files inside listview to another folder,
3. Dragging files from listview and dropping in windows explorer.

and trying to make everything work is giving problems

Thnx for your snippet.

R
"Lloyd Sheen" <a@b.cwrote in message
news:06******** *************** ***********@mic rosoft.com...
>>
"Lloyd Sheen" <a@b.cwrote in message
news:8A******* *************** ************@mi crosoft.com...
>>>
"Ratnesh Raval" <ra**********@g mail.comwrote in message
news:%2****** **********@TK2M SFTNGP06.phx.gb l...
bump

if anybody knows the answer

"Ratnesh Raval" <ra**********@g mail.comwrote in message
news:eF***** *********@TK2MS FTNGP04.phx.gbl ...
Hi All,
>
My question is on DragDrop,
>
>
>
How would I implement a Drag from listview and Drop on Desktop or any
other folder on the computer.
>
The listview contains list of files, so basically I should be able to
drop those files on other folders in my computer.
>
>
>
I hope that's possible in .net 2.0
>
>
>
Thanks
>
Ratnesh
>
>

Ratnesh,

I am at work right now so I don't have access to my home PC. I do have
a sample of drag and drop of files. It is quite simple but I will post
a little of the code when I get home.

LS
Ratnesh,

Here is some sample code:

The following are variables used for the D&D processsing of mouse moves.

Private _MouseDown As Boolean = False
Private _MouseX As Integer
Private _MouseY As Integer
Private _MouseButtons As MouseButtons
Private _SwitchContext As Boolean = False

The following happens when the mouse button is pressed over my listview

Private Sub List_MouseDown( ByVal sender As System.Object, ByVal e As
System.Windows .Forms.MouseEve ntArgs) Handles SongFileView.Mo useDown
_MouseButtons = e.Button
_SwitchContext = False
_MouseDown = True
_MouseX = e.X
_MouseY = e.Y
End Sub

The following happens on a move of the mouse. I use a test for the
distance the mouse has moved to prevent false drag drop operations:

Private Sub List_MouseMove( ByVal sender As System.Object, ByVal e As
System.Windows .Forms.MouseEve ntArgs) Handles SongFileView.Mo useMove
Dim lv As ListView = DirectCast(send er, ListView)
Dim sc As New StringCollectio n

If _MouseDown Then
If Math.Abs(_Mouse X - e.X) < 5 Or Math.Abs(_Mouse Y - e.Y) < 5
Then
Exit Sub
End If
Dim xx As DataObject = New DataObject
Dim yy As ArrayList = New ArrayList
For Each idx As Integer In lv.SelectedIndi ces
Dim li As ListViewItem = lv.Items(idx)
yy.Add(li.SubIt ems(5).Text + "\" + li.Text)
sc.Add(li.SubIt ems(5).Text + "\" + li.Text)
Next

Dim zz As Array = yy.ToArray
xx.SetFileDropL ist(sc)
xx.SetData("Lis tItems", lv.SelectedItem s)
Try
lv.DoDragDrop(x x, DragDropEffects .Copy)
_MouseDown = False
Catch ex As Exception
Dim zzzz As Integer = 1
End Try

End If
End Sub

The following will reset the D&D if the mouse button is release over the
listview:

Private Sub SongFileView_Mo useUp(ByVal sender As System.Object, ByVal
e As System.Windows. Forms.MouseEven tArgs) Handles SongFileView.Mo useUp
_MouseDown = False
End Sub
Hope this helps:

Lloyd Sheen

When you say problems, what are the problems. For a drag from explorer to
your listview you will get the DataObject passed and check to ensure that
correct format is available for what you need to do.

Lloyd

Apr 24 '07 #7

"Lloyd Sheen" <a@b.cwrote in message
news:43******** *************** ***********@mic rosoft.com...
>
"Ratnesh Raval" <ra**********@g mail.comwrote in message
news:uS******** ******@TK2MSFTN GP04.phx.gbl...
>Hey Lloyd Sheen,

Thanks for the help, that code really works.

But I am still getting some problem. Because I am trying to implement a
listview, in which
1. I am dragging files from explorer and droping in it,
2. Dragging files inside listview to another folder,
3. Dragging files from listview and dropping in windows explorer.

and trying to make everything work is giving problems

Thnx for your snippet.

R
"Lloyd Sheen" <a@b.cwrote in message
news:06******* *************** ************@mi crosoft.com...
>>>
"Lloyd Sheen" <a@b.cwrote in message
news:8A****** *************** *************@m icrosoft.com...

"Ratnesh Raval" <ra**********@g mail.comwrote in message
news:%2***** ***********@TK2 MSFTNGP06.phx.g bl...
bump
>
if anybody knows the answer
>
"Ratnesh Raval" <ra**********@g mail.comwrote in message
news:eF**** **********@TK2M SFTNGP04.phx.gb l...
>Hi All,
>>
>My question is on DragDrop,
>>
>>
>>
>How would I implement a Drag from listview and Drop on Desktop or any
>other folder on the computer.
>>
>The listview contains list of files, so basically I should be able to
>drop those files on other folders in my computer.
>>
>>
>>
>I hope that's possible in .net 2.0
>>
>>
>>
>Thanks
>>
>Ratnesh
>>
>>
>
>

Ratnesh,

I am at work right now so I don't have access to my home PC. I do have
a sample of drag and drop of files. It is quite simple but I will post
a little of the code when I get home.

LS
Ratnesh,

Here is some sample code:

The following are variables used for the D&D processsing of mouse moves.

Private _MouseDown As Boolean = False
Private _MouseX As Integer
Private _MouseY As Integer
Private _MouseButtons As MouseButtons
Private _SwitchContext As Boolean = False

The following happens when the mouse button is pressed over my listview

Private Sub List_MouseDown( ByVal sender As System.Object, ByVal e As
System.Window s.Forms.MouseEv entArgs) Handles SongFileView.Mo useDown
_MouseButtons = e.Button
_SwitchContext = False
_MouseDown = True
_MouseX = e.X
_MouseY = e.Y
End Sub

The following happens on a move of the mouse. I use a test for the
distance the mouse has moved to prevent false drag drop operations:

Private Sub List_MouseMove( ByVal sender As System.Object, ByVal e As
System.Window s.Forms.MouseEv entArgs) Handles SongFileView.Mo useMove
Dim lv As ListView = DirectCast(send er, ListView)
Dim sc As New StringCollectio n

If _MouseDown Then
If Math.Abs(_Mouse X - e.X) < 5 Or Math.Abs(_Mouse Y - e.Y) < 5
Then
Exit Sub
End If
Dim xx As DataObject = New DataObject
Dim yy As ArrayList = New ArrayList
For Each idx As Integer In lv.SelectedIndi ces
Dim li As ListViewItem = lv.Items(idx)
yy.Add(li.SubIt ems(5).Text + "\" + li.Text)
sc.Add(li.SubIt ems(5).Text + "\" + li.Text)
Next

Dim zz As Array = yy.ToArray
xx.SetFileDropL ist(sc)
xx.SetData("Lis tItems", lv.SelectedItem s)
Try
lv.DoDragDrop(x x, DragDropEffects .Copy)
_MouseDown = False
Catch ex As Exception
Dim zzzz As Integer = 1
End Try

End If
End Sub

The following will reset the D&D if the mouse button is release over the
listview:

Private Sub SongFileView_Mo useUp(ByVal sender As System.Object, ByVal
e As System.Windows. Forms.MouseEven tArgs) Handles SongFileView.Mo useUp
_MouseDown = False
End Sub
Hope this helps:

Lloyd Sheen

When you say problems, what are the problems. For a drag from explorer to
your listview you will get the DataObject passed and check to ensure that
correct format is available for what you need to do.

Lloyd
Hi Lloyd,

The problems are,

For a drag from explorer to listview, i get the dataobjects -- which are
files.
For a drag within listview, i have to pass dataobjects -- which are
listviewitems. ( so you can drop them within another folder inside listview)
For a drag from listview to explorer, i've to pass dataobjects -- which are
files (listviewitems but for explorer i've to pass them as files)

so basically, when dragging out from listview , I am not sure how to
detect, if somebody is going to drop them in listview itself or in the
explorer.
so i pass the items on listview to Dataobjects either as files or as
listviewitems.

I think i made it clear to understand.

Thanks
R
Apr 30 '07 #8

"Ratnesh Raval" <ra**********@g mail.comwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>
"Lloyd Sheen" <a@b.cwrote in message
news:43******** *************** ***********@mic rosoft.com...
>>
"Ratnesh Raval" <ra**********@g mail.comwrote in message
news:uS******* *******@TK2MSFT NGP04.phx.gbl.. .
>>Hey Lloyd Sheen,

Thanks for the help, that code really works.

But I am still getting some problem. Because I am trying to implement a
listview, in which
1. I am dragging files from explorer and droping in it,
2. Dragging files inside listview to another folder,
3. Dragging files from listview and dropping in windows explorer.

and trying to make everything work is giving problems

Thnx for your snippet.

R
"Lloyd Sheen" <a@b.cwrote in message
news:06****** *************** *************@m icrosoft.com...

"Lloyd Sheen" <a@b.cwrote in message
news:8A***** *************** **************@ microsoft.com.. .
>
"Ratnesh Raval" <ra**********@g mail.comwrote in message
news:%2**** ************@TK 2MSFTNGP06.phx. gbl...
>bump
>>
>if anybody knows the answer
>>
>"Ratnesh Raval" <ra**********@g mail.comwrote in message
>news:eF*** ***********@TK2 MSFTNGP04.phx.g bl...
>>Hi All,
>>>
>>My question is on DragDrop,
>>>
>>>
>>>
>>How would I implement a Drag from listview and Drop on Desktop or
>>any other folder on the computer.
>>>
>>The listview contains list of files, so basically I should be able
>>to drop those files on other folders in my computer.
>>>
>>>
>>>
>>I hope that's possible in .net 2.0
>>>
>>>
>>>
>>Thanks
>>>
>>Ratnesh
>>>
>>>
>>
>>
>
Ratnesh,
>
I am at work right now so I don't have access to my home PC. I do
have a sample of drag and drop of files. It is quite simple but I
will post a little of the code when I get home.
>
LS
Ratnesh,

Here is some sample code:

The following are variables used for the D&D processsing of mouse
moves.

Private _MouseDown As Boolean = False
Private _MouseX As Integer
Private _MouseY As Integer
Private _MouseButtons As MouseButtons
Private _SwitchContext As Boolean = False

The following happens when the mouse button is pressed over my listview

Private Sub List_MouseDown( ByVal sender As System.Object, ByVal e As
System.Windo ws.Forms.MouseE ventArgs) Handles SongFileView.Mo useDown
_MouseButtons = e.Button
_SwitchContext = False
_MouseDown = True
_MouseX = e.X
_MouseY = e.Y
End Sub

The following happens on a move of the mouse. I use a test for the
distance the mouse has moved to prevent false drag drop operations:

Private Sub List_MouseMove( ByVal sender As System.Object, ByVal e As
System.Windo ws.Forms.MouseE ventArgs) Handles SongFileView.Mo useMove
Dim lv As ListView = DirectCast(send er, ListView)
Dim sc As New StringCollectio n

If _MouseDown Then
If Math.Abs(_Mouse X - e.X) < 5 Or Math.Abs(_Mouse Y - e.Y) <
5 Then
Exit Sub
End If
Dim xx As DataObject = New DataObject
Dim yy As ArrayList = New ArrayList
For Each idx As Integer In lv.SelectedIndi ces
Dim li As ListViewItem = lv.Items(idx)
yy.Add(li.SubIt ems(5).Text + "\" + li.Text)
sc.Add(li.SubIt ems(5).Text + "\" + li.Text)
Next

Dim zz As Array = yy.ToArray
xx.SetFileDropL ist(sc)
xx.SetData("Lis tItems", lv.SelectedItem s)
Try
lv.DoDragDrop(x x, DragDropEffects .Copy)
_MouseDown = False
Catch ex As Exception
Dim zzzz As Integer = 1
End Try

End If
End Sub

The following will reset the D&D if the mouse button is release over
the listview:

Private Sub SongFileView_Mo useUp(ByVal sender As System.Object,
ByVal e As System.Windows. Forms.MouseEven tArgs) Handles
SongFileView .MouseUp
_MouseDown = False
End Sub
Hope this helps:

Lloyd Sheen

When you say problems, what are the problems. For a drag from explorer
to your listview you will get the DataObject passed and check to ensure
that correct format is available for what you need to do.

Lloyd

Hi Lloyd,

The problems are,

For a drag from explorer to listview, i get the dataobjects -- which are
files.
For a drag within listview, i have to pass dataobjects -- which are
listviewitems. ( so you can drop them within another folder inside
listview)
For a drag from listview to explorer, i've to pass dataobjects -- which
are files (listviewitems but for explorer i've to pass them as files)

so basically, when dragging out from listview , I am not sure how to
detect, if somebody is going to drop them in listview itself or in the
explorer.
so i pass the items on listview to Dataobjects either as files or as
listviewitems.

I think i made it clear to understand.

Thanks
R
I am not sure why you would have to have two different situations. Simply
pick the way that works with the external program in this case Explorer and
then ensure that your application will respond in the same manner. In my
app the listview items do represent files and by creating the dataobjects I
can drag from Windows into my app and from my app into windows.

If there is something I am missing please let me know I and I will see if I
can help.

Lloyd Sheen

Apr 30 '07 #9
>>
>Hi Lloyd,

The problems are,

For a drag from explorer to listview, i get the dataobjects -- which are
files.
For a drag within listview, i have to pass dataobjects -- which are
listviewitem s. ( so you can drop them within another folder inside
listview)
For a drag from listview to explorer, i've to pass dataobjects -- which
are files (listviewitems but for explorer i've to pass them as files)

so basically, when dragging out from listview , I am not sure how to
detect, if somebody is going to drop them in listview itself or in the
explorer.
so i pass the items on listview to Dataobjects either as files or as
listviewitem s.

I think i made it clear to understand.

Thanks
R

I am not sure why you would have to have two different situations. Simply
pick the way that works with the external program in this case Explorer
and then ensure that your application will respond in the same manner. In
my app the listview items do represent files and by creating the
dataobjects I can drag from Windows into my app and from my app into
windows.

If there is something I am missing please let me know I and I will see if
I can help.

Lloyd Sheen
my listview works as file explorer. so there are 3 situations
1. drag file from explorer -- drop in listview
2. drag file from listview ---drop in explorer.
3. drag file from listview ---drop inside the same listview but inside
some folder which is shown in the listview

if you look in your case, what if you want to move some file inside some
folder in listview itself ( not in the explorer),

if you want i will post it with codes.

R
Apr 30 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
5844
by: Kate | last post by:
Hi: I have a form with a picture box and some command buttons to make certain shapes appear in the picture box. The shapes are drawn on blank UserControls added like this: 'at top of form module Dim WithEvents tc As testControl 'button1_click (for example)
1
2523
by: KS | last post by:
In want to visualy drag a Button to a Label and when I depress the mousebutton on top of the label I want to show some dato from the Button in a MsgBox - that's my primary goal. I have made a simple sample code - a form with a Button1, a Label1 and a Timer1. The Button1 has Tag="SomeData", the Label1 has AllowDrop=True and the Timer1 has an Interval=20.
0
1274
by: | last post by:
I create an user control (combined form with many controls) where I process the private void DatasetControl_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) private void DatasetControl_DragEnter(object sender, System.Windows.Forms.DragEventArgs e) Now I drop this Dataset Conttrol on my main form, and I also want to process
4
3970
by: Owe Armandt | last post by:
When I play with DragDrop of files to a form I get two DragEnter events before the DragDrop event, why is this?? Owe
0
1322
by: Flack | last post by:
Hello, Is it possible to find out how many methods are listening to a certain event? For example, if a number of methods subscribed to a controls DragDrop event using +=, can I find out how many methods in total are listening to the DragDrop event of the control? If I can't find out the exact number of methods listening to the DragDrop event, can I somehow remove all listeners of that event at once? I tried using m_Control.DragDrop =...
0
1017
by: Gene Hubert | last post by:
Well, it seems fundamental to me anyway. Hopefully it is simple enough. The question is for when the source for the dragdrop is a different application that the target for the dragdrop. How does the source for the dragdrop operation know that a drop has been completed onto a valid target? And then, how does the source know what the drop target is? I've got dragdrop working within my application but I can't see any
3
3794
by: Gary Dunne | last post by:
I'm writing an app that requires drag and drop operation between a ListView and a TreeView control. (The source is the ListView). During the drag drop operation I want to be able to detect the target node in the treeview and auto expand it if applicable... but after a fair bit of head scratching I can't find any easy way to accomplish this. I think what i really need is the equivalent of the HitTest method from the COM version of the...
7
4005
by: JohnR | last post by:
I am using dragdrop to drag and drop a custom class instance. When I drag/drop from one window to another window in the same application everything works fine. But when trying to move between the same windows running in different instances of the application the "dropped" data comes across as a system.__ComObject and I can't CType it to my class to extract the data. I've been searching for hours and haven't found any solution so I am...
0
8997
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9568
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6801
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6079
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3320
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2218
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.