I have created a class library, which I then create an instance of in a form. I wish to be able to create multiple instances of this class all with different names.
My problem is that each object I create points to a single instance of the class rather than creating a new one.
Pseudo code:-
Dim obj1 As New clsJohn.MyClass
obj1.Name = "John"
Dim obj2 As New clsJohn.Myclass
obj2.name = "Fred"
at this point both obj1.name and obj2.name equal "Fred"
I have tried dim obj1 as clsjohn.myclass = new clsjohn.myclass but with no difference.
Does anyone have any ideas? Ive searched google all morning for some clues, but am completely stuck.
Hope someone can help
My problem is that each object I create points to a single instance of the class rather than creating a new one.
Pseudo code:-
Dim obj1 As New clsJohn.MyClass
obj1.Name = "John"
Dim obj2 As New clsJohn.Myclass
obj2.name = "Fred"
at this point both obj1.name and obj2.name equal "Fred"
I have tried dim obj1 as clsjohn.myclass = new clsjohn.myclass but with no difference.
Does anyone have any ideas? Ive searched google all morning for some clues, but am completely stuck.
Hope someone can help