void KeyNameTxt_TextChanged(object sender, EventArgs e) { if (KeyNameTxt.Text == "COMMENT") { CommentKeyLineChck.Checked = true; CommentKeyLineTxt.Text = "COMMENT"; CommentKeyLineTxt.Focus(); CommentKeyLineTxt.SelectionStart = CommentKeyLineTxt.Text.Length; } else { CommentKeyLineChck.Checked = false; } }
void CommentKeyLineChck_CheckedChanged(object sender, EventArgs e) { if (CommentKeyLineChck.Checked) { CommentKeyLineTxt.Visible = true; CommentKeyLineTxt.BringToFront(); label1.Text = "Comment Line"; label2.Visible = false; label3.Visible = false; } else { CommentKeyLineTxt.Visible = false; CommentKeyLineTxt.SendToBack(); label1.Text = "Key Name"; label2.Visible = true; label3.Visible = true; } }