473,395 Members | 1,986 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.

multiple formats on the clipboard

I am trying to put a FileDrop format and a Text format dataobject onto the
clipboard so that they are both available.
I seem to be able to do one or the other but when I try to put both on only
the last entry is available on the clipboard.

Dim FileDataObject As New DataObject
Dim TextDataObject As New DataObject
Dim FileNames() As String = {myFileName}
FileDataObject.SetData(DataFormats.FileDrop, FileNames)
Clipboard.SetDataObject(FileDataObject, True)
TextDataObject.SetData(DataFormats.Text, myFileName)
Clipboard.SetDataObject(TextDataObject, True)

If I run the above statements only the Text format data is available on the
clipboard. If I comment out the last line then the File Format data is
available.
Since they are different formats shouldn't they both be available at the
same time.
What am I doing wrong. How do I get both formats onto the clipboard.

Thanks,
Fred
Nov 20 '05 #1
3 2287
"fred" <So***@NoSpam.com> schrieb
I am trying to put a FileDrop format and a Text format dataobject
onto the clipboard so that they are both available.
I seem to be able to do one or the other but when I try to put both
on only the last entry is available on the clipboard.

Dim FileDataObject As New DataObject
Dim TextDataObject As New DataObject
Dim FileNames() As String = {myFileName}
FileDataObject.SetData(DataFormats.FileDrop, FileNames)
Clipboard.SetDataObject(FileDataObject, True)
TextDataObject.SetData(DataFormats.Text, myFileName)
Clipboard.SetDataObject(TextDataObject, True)

If I run the above statements only the Text format data is available
on the clipboard. If I comment out the last line then the File Format
data is available.
Since they are different formats shouldn't they both be available at
the same time.
What am I doing wrong. How do I get both formats onto the
clipboard.


You can only put /one/ object in the clipboard. The object might be returned
in different /formats/:

Const myFileName As String = "filename"

Dim FileDataObject As New DataObject
Dim FileNames() As String = {myFileName}

FileDataObject.SetData(DataFormats.FileDrop, FileNames)
FileDataObject.SetData(DataFormats.Text, myFileName)
Clipboard.SetDataObject(FileDataObject, True)
MsgBox(String.Join(vbCrLf, Clipboard.GetDataObject.GetFormats))

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
Thanks Armin.
I'd been mucking around with this for hours.
"Armin Zingler" <az*******@freenet.de> wrote in message
news:40***********************@news.freenet.de...
"fred" <So***@NoSpam.com> schrieb
I am trying to put a FileDrop format and a Text format dataobject
onto the clipboard so that they are both available.
I seem to be able to do one or the other but when I try to put both
on only the last entry is available on the clipboard.

Dim FileDataObject As New DataObject
Dim TextDataObject As New DataObject
Dim FileNames() As String = {myFileName}
FileDataObject.SetData(DataFormats.FileDrop, FileNames)
Clipboard.SetDataObject(FileDataObject, True)
TextDataObject.SetData(DataFormats.Text, myFileName)
Clipboard.SetDataObject(TextDataObject, True)

If I run the above statements only the Text format data is available
on the clipboard. If I comment out the last line then the File Format
data is available.
Since they are different formats shouldn't they both be available at
the same time.
What am I doing wrong. How do I get both formats onto the
clipboard.
You can only put /one/ object in the clipboard. The object might be

returned in different /formats/:

Const myFileName As String = "filename"

Dim FileDataObject As New DataObject
Dim FileNames() As String = {myFileName}

FileDataObject.SetData(DataFormats.FileDrop, FileNames)
FileDataObject.SetData(DataFormats.Text, myFileName)
Clipboard.SetDataObject(FileDataObject, True)
MsgBox(String.Join(vbCrLf, Clipboard.GetDataObject.GetFormats))

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
Thanks Armin.
I'd been mucking around with this for hours.
"Armin Zingler" <az*******@freenet.de> wrote in message
news:40***********************@news.freenet.de...
"fred" <So***@NoSpam.com> schrieb
I am trying to put a FileDrop format and a Text format dataobject
onto the clipboard so that they are both available.
I seem to be able to do one or the other but when I try to put both
on only the last entry is available on the clipboard.

Dim FileDataObject As New DataObject
Dim TextDataObject As New DataObject
Dim FileNames() As String = {myFileName}
FileDataObject.SetData(DataFormats.FileDrop, FileNames)
Clipboard.SetDataObject(FileDataObject, True)
TextDataObject.SetData(DataFormats.Text, myFileName)
Clipboard.SetDataObject(TextDataObject, True)

If I run the above statements only the Text format data is available
on the clipboard. If I comment out the last line then the File Format
data is available.
Since they are different formats shouldn't they both be available at
the same time.
What am I doing wrong. How do I get both formats onto the
clipboard.
You can only put /one/ object in the clipboard. The object might be

returned in different /formats/:

Const myFileName As String = "filename"

Dim FileDataObject As New DataObject
Dim FileNames() As String = {myFileName}

FileDataObject.SetData(DataFormats.FileDrop, FileNames)
FileDataObject.SetData(DataFormats.Text, myFileName)
Clipboard.SetDataObject(FileDataObject, True)
MsgBox(String.Join(vbCrLf, Clipboard.GetDataObject.GetFormats))

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #4

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

Similar topics

2
by: Trader | last post by:
Hi, I'm trying to use Mark Hammond's win32clipboard module to extract more complex data than just plain ASCII text from the Windows clipboard. For instance, when you select all the content on...
4
by: Richard Hollenbeck | last post by:
I'm trying to write some code that will convert any of the most popular standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan 1908) and compare the first with the second and...
2
by: Subodh | last post by:
Hi, Currently we get data from more then 200 different sources and all of our vendors provide data in different file formats. The problem is we have more then 100 DTS packages now and the...
0
by: Hai NIng | last post by:
Does any one know how to implement a multiple-storage clipboard, sort of like the clipboard in office where it can hold multiple number of text/image/custom data, etc.? Thanks. - Harry
2
by: **Developer** | last post by:
If I select files in Windows Explorer and click Copy I find the following formats on the clipboard. I know what FileDrop contains. How can I find out what the others are used for? FileDrop...
4
by: fred | last post by:
I am trying to put a FileDrop format and a Text format dataobject onto the clipboard so that they are both available. I seem to be able to do one or the other but when I try to put both on only...
1
by: ljlevend | last post by:
The help for the Windows.Forms.Clipboard class states, "Place data on the clipboard in multiple formats to maximize the possibility that a target application, whose format requirements you might...
4
by: Thom Little | last post by:
I have a form with three textboxes. In an external C# 2.0 application I need to load the clipboard with three pieces of information so I can position to the first textbox in the forma and select...
1
by: feltra | last post by:
Hi, The following is from my friend who has only restricted net access from his office and hence cannot post.... ...
8
by: kroogar | last post by:
Hi gurus .Net 2.0 I'm on a project where I need to be able to detect if my clipboard contains BOTH images AND text (eg. when copying from a web page). For some reason...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.