|
-
Dec 29th, 2004, 02:35 PM
#1
Thread Starter
Addicted Member
Clipboard? [Resolved]
In vb6 you could use Clipboard.GetText to get the text on the clipboard, but in .NET, this is how I had to do it:
VB Code:
Dim A As Windows.Forms.IDataObject, S() As String, S2 As String
A = Clipboard.GetDataObject()
S = A.GetFormats()
S2 = A.GetData(S(0))
Where S2 contains the text that was on the clipboard.
Is there an easier way to get the text? And to see if theres text, or an image or w/e other kind of data?
Last edited by xjake88x; Dec 30th, 2004 at 12:25 AM.
-
Dec 29th, 2004, 08:28 PM
#2
Sleep mode
You can make select case to determine if the obj , for example , is jpg ,bmp ..etc depending on the format of the picture .
Code:
Dim A As Windows.Forms.IDataObject, S() As Object, S2 As Object
A = Clipboard.GetDataObject()
S = A.GetFormats()
S2 = A.GetData(S(0))
MessageBox.Show("Object in Clipboard is :" + S2.GetType.ToString)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|