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
Post a Comment