Versions of my question come up in my searching here, but they don't quite seem to address my problem.
Simple app, one form (called, cleverly, MainForm) and several code modules, modules that have almost nothing to do with the form (other than being called by it).
The form has a browser control and a timer. Every tick one a function in one of the modules is called (depending on the tick and other things).
In one case in one of the modules the Url of the browser control (cleverly called AppBrowser) has to be set. Because the control is not public by default, I just refer to the form to make a change, like this:
This seems like the logical way to refer to things. Because of the error I'll list below, I also tried making AppBrowser public and taking off the "MainForm." part (which VS2005 is perfectly happy with, too), but it didn't solve the problem.
Here's the error I get: The form referred to itself during construction from a default instance, which led to infinite recursion. Within the Form's constructor refer to the form using 'Me.'
This confuses me. I'm not calling this in the form, I'm calling it in a separate module. How is the form referring to itself? The message seems to indicate that this module code ended up in the instance... huh?
Referring to Me.AppBrowser doesn't work, of course, because it's not the module's control.
What am I missing?
Simple app, one form (called, cleverly, MainForm) and several code modules, modules that have almost nothing to do with the form (other than being called by it).
The form has a browser control and a timer. Every tick one a function in one of the modules is called (depending on the tick and other things).
In one case in one of the modules the Url of the browser control (cleverly called AppBrowser) has to be set. Because the control is not public by default, I just refer to the form to make a change, like this:
Code:
MainForm.AppBrowser.Url = StartupURI
Here's the error I get: The form referred to itself during construction from a default instance, which led to infinite recursion. Within the Form's constructor refer to the form using 'Me.'
This confuses me. I'm not calling this in the form, I'm calling it in a separate module. How is the form referring to itself? The message seems to indicate that this module code ended up in the instance... huh?
Referring to Me.AppBrowser doesn't work, of course, because it's not the module's control.
What am I missing?