'自定义函数名
New_EmailWithNoAttachment
'内容如下
Dim frmName As String = Args(0)
Dim ctlName As String = Args(1)
'Dim New_EmailWithNoAttachment() As String = Args(2) '这句看似起了反作用,与函数同名的原因
Dim Pnl2 As WinForm.Panel = Forms(frmName ).Controls(ctlName )
Pnl2.Visible = True
'窗口内按钮调用该函数
Functions.Execute(("New_EmailwithNoAttachment"), e.form.Name, "Panel1")
'测试结果正常
'分析,楼主报错的原因可能是那句Dim New_EmailWithNoAttachment() As String = Args(2)
'总结
有几个参数就得在函数内部定义几个Args
外部调用的参数数量要与内部定义的参数数量一致。
[此贴子已经被作者于2014-10-11 17:55:15编辑过]