Trying to clear initial content of a group of TextBoxes, the set of codes below, is working: y = ActiveControl.Text; if (y == "A" || y == "B" || y == "C" || y =="D") { ActiveControl.Text = string.Empty; } But this other set is not working: if (ActiveControl[].Text.Contains("A", "B", "C", "D)) { ActiveControl.Text = string.Empty; } Though I prefer the last set of codes to the 1st one. Somebody help me out please. Thanks.
private static string[] validList = new string[] { "A", "B", "C", "D" }; ... if (validList.Contains(ActiveControl.Text)) { ... }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)