Hi,
I have a main form and I also have an additional form that is loaded from the main form. I would like to reuse an object that is declared and initialized in the main form. How can I do this? I set the child form to inherit from the main form but when I try to use the object, I receive errors indicating that it has not been declared.
Here is an example of what I have:
I have a main form and I also have an additional form that is loaded from the main form. I would like to reuse an object that is declared and initialized in the main form. How can I do this? I set the child form to inherit from the main form but when I try to use the object, I receive errors indicating that it has not been declared.
Here is an example of what I have:
Code:
public class Mainform
dim myObject as theObject = nothing
myObject = ctype(function(),theObject)
End class
public class Childform inherits Mainform
myObject.function()
End class