473,395 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

acting as a drag source without using Windows Forms

Hello,

If I have a graphic and I want to allow it to serve as drag source,
how do I do this?

Imagine that I want to drag from my application to Windows Explorer,
so that when I complete the drag-and-drop a file is copied to the
given directory. I know the way to do it if I'm using a Windows Form
is to implement DoDragDrop(), but what do I do if I am not?

I know I need to somehow create a DataObject, but then how do I ensure
that Windows uses this DataObject when it finishes the drag-and-drop
outside of my application?

Thanks so much for your help!
Dec 7 '07 #1
2 1244
Aamir,

Well, the graphic has to be hosted in something, right? You are
painting it yourself on a control or a form somewhere. ^That^ is what you
use as the drag source.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Aamir" <a2******@gmail.comwrote in message
news:d3**********************************@s19g2000 prg.googlegroups.com...
Hello,

If I have a graphic and I want to allow it to serve as drag source,
how do I do this?

Imagine that I want to drag from my application to Windows Explorer,
so that when I complete the drag-and-drop a file is copied to the
given directory. I know the way to do it if I'm using a Windows Form
is to implement DoDragDrop(), but what do I do if I am not?

I know I need to somehow create a DataObject, but then how do I ensure
that Windows uses this DataObject when it finishes the drag-and-drop
outside of my application?

Thanks so much for your help!
Dec 7 '07 #2
Thanks Nicholas - you're right - that's a good point.
Dec 7 '07 #3

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

Similar topics

2
by: SamSpade | last post by:
There seems to be two ways to put things on the clipboard ( I don't mean different formats): SetClipboardData and OleSetClipboard If I want to get data off the clipboard do I care how it was put...
3
by: Ajay Krishnan Thampi | last post by:
I have a slight problem implementing 'drag and drop' from a datagrid to a tree-view. I have pasted my code below. Someone please advice me on what to do...pretty blur right now. ==code== ...
0
by: Norbert Heidbüchel | last post by:
Hi all, I have read a lot of postings and web pages about drag and drop and treeviews, but could not find an answer to my problem. Sorry, if I missed something. I am trying to drag and drop...
0
by: James Allen Bressem | last post by:
Do drag n drop in VB.Net in ten lines of code - (too easy) I was searching through the MSDN documentation trying to figure out how to do drag n drop and I found a sample program. The sample...
1
by: Manuel Canas | last post by:
Hi there, This is the code that I am using to drag items from a list box and drop them into a text box. I'm not sure, but from what I know, each item on a list box is an object. Let say I get a...
2
by: ViRi | last post by:
I am wringing a small and lite Media Player to fit my custom needs for usage while programming. I had written some drag and drop functionality like i do with other programs, but hey, the ActiveX...
0
by: DrBonzo | last post by:
I've inherited a body of C# code that has a 'Designer Host' (DH) based UI. Custom controls are selected from a 'toolbox' window and placed/sized in the DH interface. I'm trying to add a feature...
0
by: statlerw | last post by:
I have successfully implemented drag and drop in my application to allow the reordering of columns by dragging and dropping them in the same datagridvire (Net 2.0). If i take it relatively...
4
by: SStory | last post by:
I want to drag a message from Outlook to a richtextbox on a vb.net form. I don't get the message body. I have searched all over the place and found nothing. Does anyone know how to do this? I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...

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.