I am working through some samples and tutorials, and I can't figure out the relationship between an Activity Module and a Layout. If I create a layout, add some controls, and then generate the events and code, it seems to all go into Main Activity Module. If I create a second layout and generate code, it still all goes into Main Activity Module.
Are the layouts and modules connected in some way that I am not seeing?
No, layouts and activities are not strictly related; you can load a layout even into a Panel (by code, not by Designer).
The fact is that if you generate members from within the Designer, the code will be written to the current module, even if it was not an Activity (code module, service module or class module).
So you have to pay attention to which module (Activity, in this case) is currently open.
Not exactly, if the current active module is a code module and you try to generate a Dim declaration or an event routine you get a message that this current module doesn't allow user interfaces.
Not exactly, if the current active module is a code module and you try to generate a Dim declaration or an event routine you get a message that this current module doesn't allow user interfaces.