private void textbox_Click(object sender, EventArgs e) { currentLayer = noOfLayers; currentLayer++; noOfLayers++; layers[currentLayer] = new InputLayer("input", currentLayer, "text", "firstname"); //DesignCanvas.Controls.Add(layers[currentLayer].getLabel()); /* layers[currentLayer].getLabel().Dock = DockStyle.Left; * layers[currentLayer].getLabel().BringToFront();*/ DesignCanvas.Controls.Add(layers[currentLayer].getPanel()); /* DesignCanvas.Controls.Add(layers[currentLayer].getInputDesign()); * * * layers[currentLayer].getInputDesign().Dock = DockStyle.Top; * * layers[currentLayer].getInputDesign().BringToFront();*/ layers[currentLayer].getInputDesign().Width = 300; HtmlCode.Text = writeCompleteHTML(); IndexedTextBox tempLabel = layers[currentLayer].getLabel(); tempLabel.DoubleClick += (s, er) => { tempLabel.ReadOnly = false; }; tempLabel.KeyDown += (s, key) => { if (key.KeyCode == Keys.Enter) { tempLabel.ReadOnly = true; this.ActiveControl = DesignCanvas; } }; tempLabel.TextChanged += (s, er3) => { layers[currentLayer].getLabel().Width = 15 * layers[currentLayer].getLabel().Text.Length; layers[currentLayer].getCode().getHTML().setValue(tempLabel.Text); HtmlCode.Text = writeCompleteHTML(); }; }
public override void addChoice(string value) { noOfChoices++; currentChoice = noOfChoices; choice[currentChoice] = new InputLayer("input", currentChoice, type, name, value); p.Controls.Add(choice[currentChoice].getPanel()); p.FlowDirection = System.Windows.Forms.FlowDirection.LeftToRight; p.AutoSize = true; choice[currentChoice].getInputDesign().Click += (s, er) => { IndexedFlowLayout f = (IndexedFlowLayout)choice[currentChoice].getPanel().Parent; Form1.currentLayer = f.getIndex(); }; /* choice[currentChoice].getInputDesign().Click += (s, er) => * { * System.Windows.MessageBox.Show(currentChoice.ToString()); * System.Windows.MessageBox.Show(choice[currentChoice].getIndex().ToString()); * * };*/ }