leave event fires disabling textbox below -cursor stays in 1st tex

N

nlarson11

Hello,

I have a situation where the cursor is sitting in textbox 1. The user hits
the tab key and in the leave event of textbox 1 it checks the text property
seeing if it matches a specific value. If so, it disables textbox 2 directly
below it. So by the user hitting the tab key and this occuring, the cursor
should be in textbox 3. Because at the time of hitting the tab key, textbox
2 was enabled .net just realized that it can't put focus in textbox 2 so it
cancels the keypress event and leaves the cursor in textbox 2 instead of
placing it in textbox 3.

This is extremely easy to reproduce and there is a couple of work arounds.
Is this problem known and will it be fixed anytime soon?

Thank you...Nathan - GBIS
 
R

rhaazy

Hello,

I have a situation where the cursor is sitting in textbox 1.   The userhits
the tab key and in the leave event of textbox 1 it checks the text property
seeing if it matches a specific value.  If so, it disables textbox 2 directly
below it.   So by the user hitting the tab key and this occuring, the cursor
should be in textbox 3.   Because at the time of hitting the tab key, textbox
2 was enabled .net just realized that it can't put focus in textbox 2 so it
cancels the keypress event and leaves the cursor in textbox 2 instead of
placing it in textbox 3.

This is extremely easy to reproduce and there is a couple of work arounds..  
Is this problem known and will it be fixed anytime soon?  

Thank you...Nathan - GBIS

so on your leave event for textbox1, if the text matches a particular
value, disable textbox2 and set focus for textbox3.
private void textBox1_Leave(object sender, EventArgs e)
{
if (textBox1.Text == "testCase")
{
textBox2.Enabled = false;
textBox3.Focus();

}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top