我做一个,有一个text,2个button,你自己再改,
Private Sub Command1_Click()
Text1.Locked = False
Text1.Text = ""
Text1.Text = "com1"
Text1.Locked = True
End Sub
Private Sub Command2_Click()
Text1.Locked = False
Text1.Text = ""
Text1.Text = "com2"
Text1.Locked = True
End Sub