控件函数无法调用.......请指教我写了一个控件名称 ucMenu.ctl,里面有一个函数Public Function ucCreate()
控件函数无法调用.......请指教
我写了一个控件名称 ucMenu.ctl,里面有一个函数
Public Function ucCreate()
MsgBox "a"
End Function
ucMenuPage.pag 是 ucMenu.ctl 属性页面,调用 ucCreate
Dim ucMenuObj As ucMenu
Private Sub Command1_Click()
ucMenuObj.ucCreate
End Sub
调出属性页面后,按Command1 就提示出错
实时错误 91
对象变量或 With 块变量未设置
我看别人的代码也是这样写的,都可以调用的....我这个不行,不知道哪里还没有设置
[解决办法]
在PropertyPage 属性页本身的代码里应该是这样写的
- VB code
'ucMenuPageOption ExplicitPrivate Sub Command1_Click() If (SelectedControls.Count > 0) Then SelectedControls(0).ucCreate End If End Sub
