References to references

G

Guest

I have 2 forms. In the first, I have a reference to an object. I want to
assign an object to that reference from within the second form. If I pass the
first reference to the new(...) method of the second form ByRef, I can easily
assign an object to the reference in the first form.

However, I don't want to make this assignment in the new(...) of the second
form. So I made a reference(of the same type) in the second form and assigned
it to the reference passed from the first form in the new(...) method. I
hoped that this way I could make an assignment to the reference in the second
form and change what the reference in the first form was pointing to, since
the references were assigned to each other in the new(...) method. Sort of a
reference to a reference. Unfortunately, it didn't work.

Is there a way in VB .NET to create a reference to a reference so that I can
delay the assignment of an object to a reference in another form to a method
other than the new(...)?

Michael
 
J

John Armenia

If I understad you correctly you want to pass a reference from form1 to
form2 after form2 has been created. If this indeed is what you want to do,
you could create a public method of form2 that takes the reference from
form1 as a paramater.

Sorry if I didn't undstand your question correctly.

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top