public static Control generateControl(ControlDesc desc, int position) { Control control = null; if (desc.type.Name == "Button") { control = new Button(); } if (desc.type.Name == "Label") { control = new Label(); } control.BackColor = desc.color; control.Size = desc.size; control.Location = new Point(position, 90); return(control); }
public void SetControls(ControlDesc item) { controlsDesc.Add(item); }