Results 1 to 4 of 4

Thread: clipboard

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    15

    clipboard

    all i want to know is how to copy from the text file to the clipboard and also fro mthe clipboard to other applications, say text files, for example, let say the file contains 200 strings one in each line, now i want to select only the first 10 to the clipboard and when i click another button, want to select the next 10 to the clipboard,, any idea,,, also i want to display the last string in another text box...

    do u've any idea on this..

    thanks

  2. #2
    eltiT resU motsuC Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: clipboard

    well setting stuff to the clipboard is easy

    Clipboard.Settext "Text"

    just read the file into an array... then create a string that contains 10 lines at a time... set the string to the clipboard.
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    15

    Re: clipboard

    actually, the clipboard would be like this,,
    aaa
    aab
    aac and so on,
    now the clipbaord format has to be set, as i want to copy the data to other files outside the application..
    I want to know, how to use clipboard.format and how to copy 10 lines into the clipboard from text file, not using, and display it in the same way as before in other applications..

    any idea

  4. #4
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: clipboard

    To place a piece of text in the clipboard, you use the SetText method:
    VB Code:
    1. Clipboard.SetText Text, [Format]
    where format can be 1-vbCFText (plain text, the default),
    &HBF01-vbCFRTF (text in RTF format),
    or &HBF00-vbCFLink (DDE conversation information).

    You retrieve the text currently in the clipboard using the GetText method. You can specify which format you want to retrieve using the following syntax:
    VB Code:
    1. ' For a regular TextBox control
    2. Text1.SelText = Clipboard.GetText()       ' You can omit vbCFText.
    3. ' For a RichTextBox control
    4. RichTextBox1.SelRTF = Clipboard.GetText(vbCFRTF)

    to test its current contents using the GetFormat method, which takes a format as an argument and returns a Boolean value that indicates whether the clipboard format matches the format parameter:
    VB Code:
    1. If Clipboard.GetFormat(vbCFRTF) Then
    2.     ' The Clipboard contains data in RTF format.
    3. End If
    The value of format can be
    1-vbCFText (plain text),
    2-vbCFBitmap (bitmap),
    3-vbCFMetafile (metafile),
    8-vbCFDIB (Device Independent Bitmap),
    9-vbCFPalette (color palette),
    &HBF01-vbCFRTF (text in RTF format),
    or &HBF00-vbCFLink (DDE conversation information).

    Harsh
    Show Appreciation. Rate Posts.

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