-1

I have found in an old topic this:

object newobject = Activator.CreateInstance(comboBox1.GetType); 

but doesn't work:

The best overloaded method match for System.Activator.CreateInstance(System.Type, params object[]) has some invalid arguments

The problem is I have this : http://it.tinypic.com/r/mtpcih/8

The group box is declared, not dynamically, I want to if I click the button Add one Field a new group box equal to the first one (Fields 1) appear.

At the form load event, I can create an instance of array of group box to make easier the access to data on text box?

I hope that someone can help me.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
user3289840
  • 241
  • 1
  • 2
  • 10
  • it should be better to create a usercontrol with that design(groupbox with those controls inside),and then add a new instance of it... – terrybozzio Feb 09 '14 at 15:33

1 Answers1

3
object newobjcet = Activator.CreateInstance(comboBox1.GetType()); 

You are missing the braces.

nvoigt
  • 75,013
  • 26
  • 93
  • 142