Results 1 to 2 of 2

Thread: Clipboard? [Resolved]

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2004
    Location
    USA
    Posts
    172

    Resolved 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:
    1. Dim A As Windows.Forms.IDataObject, S() As String, S2 As String
    2. A = Clipboard.GetDataObject()
    3. S = A.GetFormats()
    4. 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.

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    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
  •  



Click Here to Expand Forum to Full Width