Private Sub Command1_Click(Index As Integer)
If Index = 0 Then ’判断哪个数组控件被单击
a = Text1.SelText ‘让a等于控件text1选中的文本
Clipboard.SetText a ’把a的值加到剪切板
ElseIf Index = 1 Then Text2.Text = Clipboard.GetText ‘获取剪切板内容并赋值给text2.text
End If
End Sub
Private Sub Command2_Click()
Clipboard.Clear ’清空剪切板内容
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
End Sub