VB6.0自定义函数中的参数是对象,有什么说道没有?

2025-04-10 08:58:05
推荐回答(2个)
回答1:

'经测试两者都没问题,你实际的源码没贴上来不能看真正的原因,下面是我测试通过的代码供参考:

Private Sub Command1_Click()
test1 Text1
MsgBox "继续"
test2 Text1
End Sub

Private Sub Command2_Click()
Dim a As VBControlExtender
Dim s As String
s = "RichText.RichTextctrl.1"
Licenses.Add s
Set a = Me.Controls.Add(s, "rtxt")
a.Top = 100
a.Left = 100
a.Visible = True
End Sub

Sub test1(myText As TextBox)
myText.Text = Now & "-TextBox"
End Sub

Sub test2(myText As Object)
myText.Text = Now & "-Object"
End Sub

回答2:

textBox 是控件而不是对像