Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click ' Takes the selected text from a text box and puts it on the clipboard. If TextBox1.SelectedText <> "" Then Clipboard.SetDataObject(TextBox1.SelectedText) Else Me.Text = "No text selected in textBox1" End If End Sub 'button1_Click Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Text = Clipboard.GetDataObject.GetData(DataFormats.Text) End Sub