On validation I need to check each one of those inputs to ensure that they contain data, if one is empty I need to highlight the corresponding text. Each text control has the same name as the input control preceded by an x eg xfld1 --> fld1.
Is there any way I can loop through the input controls such that if it is empty I can highlight the corresponding text:
Conceptually the code would be something along the following lines:-
foreach (input)
{
if (input.Text == "")
{
xinput.Backcolor = color.red;
}
}
The only 2 ways I've found of achieving the requirement are either to re-declare every control as an array and iterating through the array (this is a bit complex with multiple input types) or individually checking every input control (VERY tedious).
TIA
Doug
By the way, I'm programming for the Compact Framework which is missing a chunk of functionality.