PrivateSub button1_Click(sender AsObject, e As System.EventArgs) '从TextBox控件中把选中的文字内容复制到剪贴板. If textBox1.SelectedText <>""Then Clipboard.SetDataObject(textBox1.SelectedText) Else textBox2.Text ="你还没从textBox1控件中选中任何文本内容!" EndIf EndSub '更多原创VB.Net学习笔记,来自lob.cn乐博网 PrivateSub button2_Click(sender AsObject, e As System.EventArgs) ' 定义一个IDataObject对象来获取剪贴板的内容. Dim iData As IDataObject = Clipboard.GetDataObject()