请问怎么样用函数给不同TEXTBOX赋值?
例如 有3个textbox
textbox1
textbox2
textbox3
请问怎么用函数给这三个TEXTBOX赋值?
例如 SetTextBox( "textbox1","abc") 就把 textbox1.text ="abc"
SetTextBox( "textbox2","abcd")
[解决办法]
Private Sub SetTextBox(TextBox As TextBox, Optional Text As String = "")
TextBox.Text = Text
End Sub
Private Sub Command1_Click()
SetTextBox textbox1, "abc"
SetTextBox textbox2, "abcd"
End Sub
Private Sub Command2_Click()
'下面这两句效果等同:
SetTextBox textbox1
SetTextBox textbox1, vbNullString
End Sub