winforms - C# adding control from another class -


i want add form controls dynamically form class inherits form class. works fine not add controls @ run time.

here sample code:

namespace namespace1 {  public partial class form1 : form    {     .....    }   .......  }// end of namespace1  namespace namespace2 { public class1:form1 { public button button = new button();  public void method1()   {    button1.name="button1";   //flowlayoutcontrol1 public control on form1   flowlayoutcontrol1.controls.add(button1);   } 

} }


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -