Because of the filesize, I decided to split up my main .cs file into smaller pieces. The namespace is E2O everywhere, and one of the files I created should hold all database-related stuff. So, it looks like this:
namespace E2O
{
public class DB
{
public DB()
{
//constructor
}
public static void xyz()
{
if(E2O.frmMain.checkbox1.Checked)
{
blabla...
}
}
}
}
Now why can’t I refer to checkbox1? The compiler gives the error:
An object reference is required for the nonstatic field, method, or property ‘E2O.frmMain.checkBox1’
The object is defined as public (not the default private), but I can’t get to it. HOW? I know, I should probably go out and buy a C# book, but the only thing I want to accomplish is make the maintainability a little easier, the functions work perfectly when they are in one big file.
If anybody knows, please comment, your help will be greatly appreciated.