public void AddSetupRow(string setupId, string buttonName, Form form, Bitmap buttonImage = null) { var button = new SetupButton(setupId, buttonName, buttonImage); button.Click += delegate { form.ShowDialog(); }; flowSetup.Controls.Add(button); }
public void AddSetupRow(string setupId, string buttonName, Type formType, Bitmap buttonImage = null) { var button = new SetupButton(setupId, buttonName, buttonImage); var form = (Form)Activator.CreateInstance(formType); button.Click += delegate { form.ShowDialog(); }; flowSetup.Controls.Add(button); }