Hi Clyde,
Thanks for you feedback.
I think I understand your meaning. I have done a lot research for you.
First you should be clear that the dragdrop effect should be handled by the
possible drop target container, but not the drag source.
When the drag entered your application area, you should determine the drag
source's data through the clipboard. However, you should only determine if
the clipboard contains you wanted data format.
Generally, the windows will not place all the data of drag source into the
clipboard, while it only places some certain information into the
clipboard(For example, only the filename, the file content's stream
pointer). So I think you should use the file information to retreive the
file icon, then you must draw the file icon with the mouse cursor. This all
can be done in the DragEnter and DragOver event.
But I think these steps are very complex, I recommand you do not do this.
As you can see, the Microsoft Outlook, MSN, and other applications all did
not implement this effect(file icon with curso). The windows explorer and
Internet Explorer implement this effect, because they have more information
than other applications.
So I really recommand you not implement this effect.
Hope this helps,
Best regards.
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
| Content-Class: urn:content-classes:message
| From: "Clyde LeFevre" <
[email protected]>
| Sender: "Clyde LeFevre" <
[email protected]>
| References: <
[email protected]>
<
[email protected]>
<
[email protected]>
<
[email protected]>
| Subject: Re: Drag and Drop like Windows Explorer
| Date: Thu, 30 Oct 2003 09:45:45 -0800
| Lines: 49
| Message-ID: <
[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcOfDaVB98soo0s9QLetkj/am2zrBg==
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:195469
| NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| I don't have a problem with the drag and drop action. I
| am using the DataGrid DragDrop, DragEnter, and DragOver
| events.
| When I start a drag, the cursor converts to an arrow with
| two small boxes along the tail of the arrow. I know I can
| change the cursor. What I would like to do is add the
| small bitmap along with the cursor like Windows Explorer
| does when you start to drag a file.
|
| I don't know if the Explorer effect is a cursor only or a
| cursor plus bitmap. If it is a cursor only, can you
| provide some help in creating cursors on-the-fly of
| arbitrary size? If it is a bitmap, how is the bitmap
| generated on-the-fly?
| >-----Original Message-----
| >
| >Hi Clyde,
| >
| >I think you should refer to the DataGrid's DragEnter,
| DragDrop, DragOver
| >event which are inherited from Control's DragEnter,
| DragDrop, DragOver
| >event.
| >You can change the cursor display by changing the
| DragEventArgs with
| >DragDropEffects enumerate.
| >You also can use e.Data.GetDataPresent method to
| determine the source
| >data's format.
| >You can find many small samples of these events in MSDN.
| >
| >For your datagrid dragdrop, if you want to add this
| source data into the
| >datagrid, I think you should add this source data into
| the dataset, then
| >the datagrid will reflect the change. Then if you want to
| update the
| >database, you should use SqlDataAdapter's Update method.
| >
| >If you still have anyting unclear, please feel free to
| let me know.
| >
| >Best regards,
| >Jeffrey Tan
| >Microsoft Online Partner Support
| >Get Secure! -
www.microsoft.com/security
| >This posting is provided "as is" with no warranties and
| confers no rights.
| >
|