public void MultiplyControl() { if (model.currentClickedControl is CLabel) { CLabel lbl = ControlFactory.BuildCLabel(model.currentClickedControl.Parent); lbl.cd.Top = model.currentClickedControl.Top + 25; lbl.cd.Left = model.currentClickedControl.Left; lbl.cd.Width = model.currentClickedControl.Width; lbl.cd.RealSubDestination = (model.currentClickedControl as ICustomControl).cd.RealSubDestination; lbl.cd.RealMainDestination = (model.currentClickedControl as ICustomControl).cd.RealMainDestination; lbl.cd.DestinationType = (model.currentClickedControl as ICustomControl).cd.DestinationType; model.currentClickedControl = lbl; } else if (model.currentClickedControl is CTextBox) { CTextBox txtb = ControlFactory.BuildCTextBox(model.currentClickedControl.Parent); txtb.cd.Top = model.currentClickedControl.Top + 25; txtb.cd.Left = model.currentClickedControl.Left; txtb.cd.Width = model.currentClickedControl.Width; txtb.cd.RealSubDestination = (model.currentClickedControl as ICustomControl).cd.RealSubDestination; txtb.cd.RealMainDestination = (model.currentClickedControl as ICustomControl).cd.RealMainDestination; txtb.cd.DestinationType = (model.currentClickedControl as ICustomControl).cd.DestinationType; model.currentClickedControl = txtb; } Model.getInstance().uiChanged = true; }
public void textBoxToolStripMenuItem_Click(object sender, EventArgs e) { CTextBox textBox = ControlFactory.BuildCTextBox(model.currentClickedControl); editor = new ControlEditor(); editor.Show(textBox); }