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 BantheswaranRank #170 · 14.1K reputationPosted Jul 14, 2014, 11:32 PM EDT
You can write it on OnTextChanged event.
varsha dodiyaRank #4,270 · 354 reputationPosted Jul 14, 2014, 11:39 PM EDT
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Jul 15, 2014, 12:12 AM EDT
Khan Abrar AhmedRank #778 · 3K reputationPosted Jul 15, 2014, 12:16 AM EDT
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 dodiyaRank #4,270 · 354 reputationPosted Jul 15, 2014, 12:50 AM EDT
Khan Abrar AhmedRank #778 · 3K reputationPosted Jul 15, 2014, 12:56 AM EDT
or in Page load after all the controls are filled then u call the method.
varsha dodiyaRank #4,270 · 354 reputationPosted Jul 15, 2014, 1:00 AM EDT
Khan Abrar AhmedRank #778 · 3K reputationPosted Jul 15, 2014, 1:07 AM EDT
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;
}
}
}}