Drstein99
Well-known member
Please help, I cant figure out why I cant call the following function (being called from form1.vb):
says "is a type and can not be used as an expression"
CallByName(globalFunction, "YesOrNo", CallType.Method)
I have the CLASS in my mainmodule.vb, defined outside the "MODULE MAIN" definition
Public Class globalFunction
Private Function YesOrNo()
If MsgBox("pQuestion", MsgBoxStyle.YesNo, "Script Question") = MsgBoxResult.Yes Then
Return pAnswer1
Else
Return pAnswer2
End If
End Function
End Class
says "is a type and can not be used as an expression"
CallByName(globalFunction, "YesOrNo", CallType.Method)
I have the CLASS in my mainmodule.vb, defined outside the "MODULE MAIN" definition
Public Class globalFunction
Private Function YesOrNo()
If MsgBox("pQuestion", MsgBoxStyle.YesNo, "Script Question") = MsgBoxResult.Yes Then
Return pAnswer1
Else
Return pAnswer2
End If
End Function
End Class