kevinheeney
Newcomer
- Joined
- Jun 24, 2003
- Messages
- 20
VB.NET
Hello,
I am having a problem with copying one class into another. In the following example (a much more detailed example is attached) I have declared to instances of the same class.
When I Make one = another they become linked. So if I change TopClass at all BottomClass changes as well. I don't want BottomClass to be a reference to TopClass, I just want to copy the data as it is at that instant.
Dim TopClass As New Class1
Dim BottomClass As New Class1
BottomClass = TopClass
But I don't want to go through and do...
BottomClass.First = TopClass.First
BottomClass.Last= TopClass.Last
which would keep that from happening.
Kevin
Hello,
I am having a problem with copying one class into another. In the following example (a much more detailed example is attached) I have declared to instances of the same class.
When I Make one = another they become linked. So if I change TopClass at all BottomClass changes as well. I don't want BottomClass to be a reference to TopClass, I just want to copy the data as it is at that instant.
Dim TopClass As New Class1
Dim BottomClass As New Class1
BottomClass = TopClass
But I don't want to go through and do...
BottomClass.First = TopClass.First
BottomClass.Last= TopClass.Last
which would keep that from happening.
Kevin
Attachments
Last edited: