Results 1 to 3 of 3

Thread: copy highlighted richtextbox text to clipboard vb.net

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2011
    Posts
    137

    Smile copy highlighted richtextbox text to clipboard vb.net

    I'm from Lithuania so do not surprize if you see program in LT version

    Hi i have only ths code for so far so maby someone will know
    how to copy only highlighted text like in the picature shown

    Exaple: what i want to copy like so

    www.blabla.com/2013
    www.ggg.com/2013 and so on to clipboard and other leave as it is not to copy.

    Name:  584e450a9827768b0fb5b5214e43dc8d.png
Views: 4227
Size:  71.7 KB

    Here is what i have for so far
    It copies only one selected text.
    But i want to copy to clipboard only highlighted like in the picture shown

    Code:
     If RichTextBox1.SelectedText <> "" Then
                'Copy the information to the clipboard
                Clipboard.SetText(RichTextBox1.SelectedText)
            Else
                'If no text was selected, print out an error message box
                MsgBox("No text is selected to copy")
            End If
    and this copy all but not in new line

    Code:
     If True Then
                ' Check if selection exists and that it's not null
                If RichTextBox1.SelectionLength > 0 Then
                    ' Copy the selected text to the Clipboard
                    Clipboard.SetText(RichTextBox1.Text, TextDataFormat.Text)
                End If
            End If
    Last edited by polas; Oct 25th, 2012 at 09:37 AM.

Tags for this Thread

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