J
Jared
Hi,
Problem is when I update a copy of a object variable it updates the object
variable it was copied from. see code below..
Sub Main()
Dim cat1 As New cat
Dim cat2 As cat
cat1.Color = ConsoleColor.Black
cat2 = cat1
cat2.Color = ConsoleColor.Blue
Trace.WriteLine(cat1.Color.ToString)
End Sub
Public Class cat
Dim mColor As ConsoleColor
Public Property Color() As ConsoleColor
Get
Return mColor
End Get
Set(ByVal value As ConsoleColor)
mColor = value
End Set
End Property
End Class
All the dam cats are now blue!!! I only want cat 2 to be blue.
TIA
Jared
Problem is when I update a copy of a object variable it updates the object
variable it was copied from. see code below..
Sub Main()
Dim cat1 As New cat
Dim cat2 As cat
cat1.Color = ConsoleColor.Black
cat2 = cat1
cat2.Color = ConsoleColor.Blue
Trace.WriteLine(cat1.Color.ToString)
End Sub
Public Class cat
Dim mColor As ConsoleColor
Public Property Color() As ConsoleColor
Get
Return mColor
End Get
Set(ByVal value As ConsoleColor)
mColor = value
End Set
End Property
End Class
All the dam cats are now blue!!! I only want cat 2 to be blue.
TIA
Jared