???? ID: 306969 - ????? ???????: 04 ?????? 2010 - ??????: 2.0 How to provide file drag-and-drop functionality in a Visual Basic 2005 or Visual Basic .NET application
?? Microsoft Visual C# .NET ??????? ?? ??? ?? ???? ??, ?????307966
(http://support.microsoft.com/kb/307966/
)
. ?? ????? ????????The step-by-step procedure in this article demonstrates how to provide file drag-and-drop functionality in a Microsoft Visual Basic 2005 or Microsoft Visual Basic .NET application. AListBoxcontrol is used as the destination of the file drag-and-drop procedure. ??????????????? ???? outlines ???????? ?????????, ??????????, ??????? ??????, ?? ???? ???? ???:
????? ????? ?? ??? ???TheListBoxcontrol provides two drag-and-drop events that you need to handle:DragEnter, ??DragDrop. TheDragEnterevent occurs when you drag an object within the bounds of the control and is used to determine whether the object that is being dragged is one that you want to allow to be dropped on the control. You handle this event for cases in which a file or files are dragged to the control. This allows the appropriate icon to be displayed when the object is dragged over the control, depending on the object that is being dragged. TheDragDropevent occurs when the object that is being dragged has been released on the control. You handle this event to retrieve the object. The????:object is used to retrieve the data.The????:object'sGetDatamethod returns an array of strings that contain the full path names of the files that were dragged to theListBox???????? ??? You can use this file path information to perform whatever operations are needed on the files. For example, you can use classes in theSystem.IOnamespace to open and read the files, move the files, or copy the files to a new location. This sample only adds the full path to the files that are dragged to theListBox???????? ??? ????? ???? Visual Basic 2005 ?? Visual Basic .NET ????????? ??? ?????-????-????? ??????????? ??????, ?? ????? ?? ???? ????:
?????????? ??????? ?? ???, ????? Microsoft ?????? ??????? (MSDN) ??? ?????? ?? ????:: (vs.71) http://msdn2.Microsoft.com/en-us/library/SYSTEM.Windows.forms.control.dragenter .aspx
(http://msdn2.microsoft.com/en-us/library/system.windows.forms.control.dragenter(vs.71).aspx)
(vs.71) http://msdn2.Microsoft.com/en-us/library/SYSTEM.Windows.forms.control.dragdrop .aspx (http://msdn2.microsoft.com/en-us/library/system.windows.forms.control.dragdrop(vs.71).aspx) ???? ???? ???? ??:
???? ?????? ??????????????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??. ?????????? ?? ??????? ????????? ??????? ??:306969
(http://support.microsoft.com/kb/306969/en-us/
)
| ???? ?????? ???? ?????? ??????
????????? ?????? ??????? ???????? ??????
|






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email

????? ?? ???? ????
