events - Reference to a non-shared member requires an object reference (VB.net 2010) -

hi guys! need program problem, creating events. shows "reference non-shared member requires object reference". don't have idea how solve problem. thanks
it means did not create instance of object , trying call it's methods directly on non-shared member.
example:
public class foo public sub bar(foobar string) 'some stuff end sub end class you doing similar this:
foo.bar("foobar") when need this:
dim _foo new foo _foo.bar("some foobar") otherwise this:
public class foo public shared sub bar(foobar string) 'some stuff end sub end class then can do:
foo.bar("foobar")
Comments
Post a Comment