471,325 Members | 1,447 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,325 software developers and data experts.

TextBox 'Leave' Event not working

Hi,

I have an application that has (for the sake of argument) 2 (MDI) windows
open.
If I click into a textbox on FormA then the 'Enter' event for that TextBox
fires, great!
However, if I then click on FormB, then back to FormA although the cursor is
still flashing in the same textbox on FormA, when I tab out, the 'Leave'
event for that TextBox does not fire. If I stay on FormA and Shift-Tab back
into the textbox then the 'Enter' event fires again, then when tabbing out
again the 'Leave' event does fire this time...

Is this behaviour expected/normal, or am I doing somthing wrong. I will test
it with a couple of very simple forms if necessary, but thought I'd see if
people had any thoughts first :-)

Thanks,

Chris.
Jul 21 '05 #1
1 2862
OK,

I did what I said, to test, I've made a very simple Windows App. 1 MDI
Parent containing 2 Children.
FormA has 2 TextBoxes and a ListBox, and I've wired it up so that it bangs
an 'In' or 'Out' into the ListBox everytime one of the TextBoxes (TextBoxA)
Enter or Leave Event fires. The following table shows what goes into the
list box for each of the following actions...

Tab To TextBoxB Out
Tab back to TextBoxA In
Tab to TextBoxB Out
Tab Back To 1st TextBoxA In

<So Far So Good>

Click on FormB Out, Out
<Not Sure I understand that?>
Click back on FormA In
FormB Out
FormA In

<Making sense apart from the 1st one>
If you're not following this, we are now back on the FormA in TextBoxA

Tab to TextBoxB <NOTHING!!>
<Focus moves to other TB, but Leave event doesn't fire!>>
Back to TextBoxA In
Back to other TextBoxB Out
Back to 1st TextBoxA In
Can anyone give me a logical explaination for this behaviour, and give me
some ideas bout how I can get it to work as required (Leave event ALWAYS
fires when TextBox loses focus).

Thanks,

Chris.

"Chris Mayers" <ch**************@SUEDEYahoo.Com> wrote in message
news:er**************@TK2MSFTNGP12.phx.gbl...
Hi,

I have an application that has (for the sake of argument) 2 (MDI) windows
open.
If I click into a textbox on FormA then the 'Enter' event for that TextBox
fires, great!
However, if I then click on FormB, then back to FormA although the cursor is still flashing in the same textbox on FormA, when I tab out, the 'Leave'
event for that TextBox does not fire. If I stay on FormA and Shift-Tab back into the textbox then the 'Enter' event fires again, then when tabbing out
again the 'Leave' event does fire this time...

Is this behaviour expected/normal, or am I doing somthing wrong. I will test it with a couple of very simple forms if necessary, but thought I'd see if
people had any thoughts first :-)

Thanks,

Chris.

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Zyrthofar | last post: by
2 posts views Thread by AussieRules | last post: by
6 posts views Thread by Frank | last post: by
1 post views Thread by Chris Mayers | last post: by
1 post views Thread by melanieab | last post: by
5 posts views Thread by =?Utf-8?B?QmVuIFIu?= | last post: by
2 posts views Thread by jd | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.