When I\'m building, VS show error. This is my code:
public Composite buildComposite(ComboBox subs, ComboBox bas)
{
int count = 0;
Composite a = new C
Your Composite class is not public. You can't return a non-public type from a public method.
If you don't specify an accessibility for a non-nested class then internal is used by default. Add public to your Composite class definition:
public class Composite
{
...
Alternatively, if buildComposite doesn't need to be public (meaning it's only used internally by the form), then you could make the method private as well:
private Composite buildComposite(ComboBox subs, ComboBox bas)
{
....