View Single Post
Old June 1st, 2013, 12:31 PM
John S John S is offline
Authorized User
Points: 179, Level: 3
Points: 179, Level: 3 Points: 179, Level: 3 Points: 179, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: May 2013
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts

Ok, maybe I'm being dense here (it happens).

Your Project has a form named Form1, and then you click Project, Add Windows Form. It asks for a name and you name it ColorForm.cs.

This opens the second form in the Designer, with Properties: Text = "ColorForm" and (Name) = ColorForm.

Got that.

Now you said "The code creates an instance of it and names if remoteColorForm."

Ok, I see that in your:

ColorForm remoteColorForm;


remoteColorForm = new ColorForm();

Got that.

But how does the program know that "remoteColorForm" refers to the form in the Designer which is identified as "ColorForm"?

Is there some code in the background, similar to what created Form1, that equates remoteColorForm to the form Named ColorForm?

When code executes in Form1, how does it know to change the Properties of ColorForm?

where does "ColorForm" = "remoteColorForm" ?

To me, that's like saying "make the dog's tail wag" and having the cat's tail wag instead!