you are ending up with 2 names for the same object
remember - object variables are reference types
to avoid this (if you need to)
create a different object and just copy the values into the new object -
being careful not to make the same mistake on member objects of the object
you're copying -
or - look up the clone method
"Ricky W. Hunt" <(E-Mail Removed)> wrote in message
news:wZbSc.282915$XM6.153027@attbi_s53...
> I came across something by accident; assigning one object to another (as
in
> object1 = object2) allows me to "work on" object2 just like it was
object1.
> For instance, in order to be able to reference a textbox on form1 I
created
> a textbox at module level called PassTextBox and assigned the original
> textbox to it (textbox1 = PassTextBox) in Form1's load code. I was
planning
> on just using this as a "hold" area and when I got back into Form1 I could
> assign PassTextBox back to textbox1. But I found out that whatever I did
to
> PassTextBox (such as changing the .text property) WAS ALREADY DONE IN
> textbox1! So this makes me think there's something inherent in the object
> that I can't see (or am not aware of) that contains an address (pointer).
> Are the two textboxes two separate entities that just "point" to the same
> place? I see this could open up a lot of possibilities but also a lot of
> potential problems. How do you make a true "copy" of an object (so that
> changing a property in one doesn't affect the other)? It's almost like the
> assign is working ByRef instead of ByVal.
>
> --
> Thanks,
> Ricky W. Hunt
> freendeed
>
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.732 / Virus Database: 486 - Release Date: 7/30/2004