Interviews2 answers
2 Answers
Use textbox events like change, keyup, keydown, keypress events ...
Man MundhraPosted Mar 10, 2023, 6:59 AM EST
private bool CheckZeroValue(Panel Container1)
{
foreach (Control control in Container1.Controls)
{
if (control is TextBox)
{
TextBox textBox = (control as TextBox);
if (string.IsNullOrEmpty(textBox.Text.Trim()))
{
throw new Exception("Either Null or Empty !");
textBox.Focus();
return false;
}
}
}
return true;
{
foreach (Control control in Container1.Controls)
{
if (control is TextBox)
{
TextBox textBox = (control as TextBox);
if (string.IsNullOrEmpty(textBox.Text.Trim()))
{
throw new Exception("Either Null or Empty !");
textBox.Focus();
return false;
}
}
}
return true;
subhank PPosted Apr 3, 2013, 7:28 AM EDT

