in winforms ,, i want to set tabstop property false of some textbox,
if textbox is already filled with some text then its tabstop should be false
i did
if(textbox1.text!="")
{
textbox1.text.tabstop=false;
}
if(textbox2.text!="")
{
textbox2.text.tabstop=false;
} but under which event should i write it ? help me plz

Jaganathan BantheswaranPosted Jul 15, 2014, 3:32 AM
You can write it on OnTextChanged event.
Khan Abrar AhmedPosted Jul 15, 2014, 5:07 AM
like thais
protected void OnTextChanged_FirstName(object sender, EventArgs e)
{
getNameFormUi();
}
private void getNameFormUi()
{foreach (Control c in Page.Controls)
{
foreach (Control childc in c.Controls)
{
if (childc is TextBox)
{
if(!string.isnullorEmpty(childc.Text)
childc.text.tabstop=false;
}
}
}}
varsha dodiyaPosted Jul 15, 2014, 5:00 AM
Khan Abrar AhmedPosted Jul 15, 2014, 4:56 AM
or in Page load after all the controls are filled then u call the method.
varsha dodiyaPosted Jul 15, 2014, 4:50 AM
Khan Abrar AhmedPosted Jul 15, 2014, 4:16 AM
foreach (Control c in Page.Controls)
{
foreach (Control childc in c.Controls)
{
if (childc is TextBox)
{
if(!string.isnullorEmpty(childc.Text)
childc.text.tabstop=false;
}
}
}
Jaganathan BantheswaranPosted Jul 15, 2014, 4:12 AM
varsha dodiyaPosted Jul 15, 2014, 3:39 AM