C# accessing GUI object outside of the mainform class
Posted on 2011-02-23
I have a MainForm class and a UI class. The UI class is meant to handle things like populating tables and handling actions of the UI. The item I'm trying to add objects to is a list and is defined in the MainForm class as "CompsList".
I tried to access that list with the code:
I get an error on the THIS statement, and if I remove that, I get a message stating CompsList doesn't exist.
How can I access the object to add or remove items when I want to?