Access a property in another form

  • Thread starter Thread starter Diego F.
  • Start date Start date
D

Diego F.

I'm writing an application that has some forms. I need an object in the main
form, but I'm not sure about how to access it from other forms.

Which is the best way to do it? Can I declare the object as static and
access directly the form?
 
I'm writing an application that has some forms. I need an object in the main
form, but I'm not sure about how to access it from other forms.

Which is the best way to do it? Can I declare the object as static and
access directly the form?

You could pass your other forms a reference to the main form when you are
creating them too and then have the object they need to access exposed as
a public field or property.
 
Back
Top