private void AddControls(String Name, int pointX, int pointY, childForm childForm) { TextBox newTextBox = new TextBox(); newTextBox.Name = "txt@" + Name; newTextBox.Text = string.Empty; newTextBox.Location = new Point(pointX, pointY); newTextBox.Width = 800; newTextBox.WordWrap = true; newTextBox.BackColor = System.Drawing.Color.Azure; // newTextBox.Font = new Font(newTextBox.Font, FontStyle.Bold); Button btnSet = new Button(); btnSet.Name = "btnSet@" + Name; btnSet.Text = "Set"; btnSet.Location = new System.Drawing.Point(850, pointY); btnSet.Click += btnSet_Click; btnSet.BackColor = System.Drawing.Color.Silver; btnSet.Font = new Font(btnSet.Font, FontStyle.Bold); Button btnDelete = new Button(); btnDelete.Name = "btnDelete@" + Name; btnDelete.Text = "Delete"; btnDelete.Location = new System.Drawing.Point(950, pointY); btnDelete.Click += btnDelete_Click; btnDelete.BackColor = System.Drawing.Color.Silver; btnDelete.Font = new Font(btnDelete.Font, FontStyle.Bold); childForm.Controls.Add(newTextBox); childForm.Controls.Add(btnSet); childForm.Controls.Add(btnDelete); }
public void DisplayChildForm(ScriptExecutionManager scriptExeManager) { pointX = 30; pointY = 20; childForm form = new childForm(scriptExeManager); form.AutoScroll = true; form.Show(); }
public void LoadChildFormWithScriptDetails(childForm childForm) { //pointX = 30; //pointY = 20; childFrominstance = childForm; Button btn = new Button(); btn.Name = "btnEdit"; btn.Text = "Edit Configuration"; btn.Location = new System.Drawing.Point(pointX, pointY); btn.Click += btn_Click; btn.BackColor = System.Drawing.Color.Silver; btn.Font = new Font(btn.Font, FontStyle.Bold); btn.Width = 200; childForm.Controls.Add(btn); Button btnSave = new Button(); btnSave.Name = "btnSave"; btnSave.Text = "Save Configuration"; btnSave.Location = new System.Drawing.Point(300, pointY); btnSave.Click += btnSave_Click; btnSave.BackColor = System.Drawing.Color.Silver; btnSave.Font = new Font(btnSave.Font, FontStyle.Bold); btnSave.Width = 200; childForm.Controls.Add(btnSave); Button btnAdd = new Button(); btnAdd.Name = "btnAdd"; btnAdd.Text = "Add a new path"; btnAdd.Location = new System.Drawing.Point(600, pointY); btnAdd.Click += btnAdd_Click; btnAdd.BackColor = System.Drawing.Color.Silver; btnAdd.Font = new Font(btnAdd.Font, FontStyle.Bold); btnAdd.Width = 200; childForm.Controls.Add(btnAdd); pointY += 40; if (loader.ScriptFiles != null) { if (loader.ScriptFiles.Count > 0) { foreach (var item in loader.ScriptFiles) { AddControls(item, pointX, pointY, childForm); pointY += 30; } } } }