Drstein99 Posted October 30, 2003 Posted October 30, 2003 Please help, I can't figure out why I can't 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 Quote www.DRSTEIN99.com www.RAIDGEAR.net www.THERE.com -> Tell them DrStein99 sent ya!
CattleRustler Posted November 8, 2003 Posted November 8, 2003 try Friend Function Quote mod2software Home of the VB.NET Class Builder Utility - Demo and Full versions available now!
Administrators PlausiblyDamp Posted November 9, 2003 Administrators Posted November 9, 2003 try declaring the method as shared. If that doesn't work could you post the code just before the error? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Drstein99 Posted November 10, 2003 Author Posted November 10, 2003 Well, I since then figured out what I was doing wrong. Had to declare a class in the main.vb. Then from the class I added functions and works fine. Quote www.DRSTEIN99.com www.RAIDGEAR.net www.THERE.com -> Tell them DrStein99 sent ya!
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.