private void txtFirstName_Enter(object sender, EventArgs e) { TextBox txt = (TextBox)sender; string t = txt.Name.Substring(3, txt.Name.Length - 3); if (txt.Text.ToLower() == t.ToLower()) { txt.ForeColor = System.Drawing.Color.Black; txt.Text = ""; } } private void txtFirstName_leave(object sender, EventArgs e) { TextBox txt = (TextBox)sender; string t = txt.Name.Substring(3, txt.Name.Length - 3); if (txt.Text.ToLower() == t.ToLower() || txt.Text == "") { txt.ForeColor = System.Drawing.Color.Silver; txt.Text = t; } else { txt.ForeColor = System.Drawing.Color.Black; } }
string t = txt.Name.Substring(3, txt.Name.Length - 3);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)