I\'m trying to pass a list from one form class to another. Here\'s the code:
List myArgus = new List();
private void btnLogin_Cl
You have to declare Branch
to be public:
public class Branch {
. . .
}
As the error message says, the type of all parameters of a method must be at least as accessible as the method itself.
You need to make your Branch
class public if you are using it as a parameter in a public method.
public class Branch { .... }
^^^^^^
Alternatively you could change your method to be internal
instead of public
.
internal BranchOverview(List<Branch> myArgus)
^^^^^^^^
By default, fields of a class are private
if no access modifier
is present ...
Change:
List<Branch> myArgus = new List<Branch>();
to be public.
The constructor of BranchOverview
is public
, which means that all types involved in its formal parameter list must also be public
. Most probably you have not provided an accessibility specification for Branch
, i.e. you have written
class Branch { ... }
which means that Branch
is internal
.