public void AddComment(string comment) { BtnLetsCook.Click(); Stars.Submit(); TxtComment.SendKeys(comment); BtnAddComment.Click(); }
void buttonArray_Click(object sender, EventArgs e) { //Use sender to identify which button in array was pressed var current = sender as Button; //Use name of button to get WBS number: TxtWBS_xxxxxxxx where xxxxxxxx starts on position 7 TxtWBS.Text = current.Name.Substring(7); //Find corresponding WBS description foreach (Control c in this.Controls) { if (c.Name == "TxtWBSDescription_" + current.Name.Substring(7)) { TxtWBSDescription.Text = c.Text; } } TxtComment.Focus(); }
protected void Txtcreditamt_TextChanged(object sender, EventArgs e) { TxtComment.Focus(); }