472,378 Members | 1,285 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,378 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 2235
"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: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

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.