473,414 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 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 3184
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: JayDee | last post by:
After a user enters data into a field, I need to populate other controls on the form, based on the user entry. I have to use either Leave, Validating or Validated, and I take it I can't use...
1
by: Zyrthofar | last post by:
Hi I have three textboxes indicating the individual RGB values of a color. When the user leaves a textbox (Leave event), I check the validity of that number and saves the three values to a set of...
2
by: AussieRules | last post by:
Hi, I have a form with many textbox on it. Behind this(so to speak), is a class, and each time the user changes the value of the text box I want to update the relevant property of the class. ...
6
by: Frank | last post by:
Hopefully this is the correct group for this message. My previous post to (I assume) a non-.net group was not welcomed. I have a form with 7 text boxes that are all bound to fields of a...
1
by: Chris Mayers | last post by:
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...
1
by: melanieab | last post by:
Hi again, I have a textbox where the text is longer than the textbox width. When I type something in there or even do any single keystroke (other than tab, up, down, or enter) and then leave, the...
5
by: =?Utf-8?B?QmVuIFIu?= | last post by:
Hi, In a .NET 2.0 winforms application, I've got a textbox that, when updated, uses the validated event to cascade the change to another textbox (along with another value). This works well if...
4
by: dbuchanan | last post by:
On the help page "TextBox Members" clearly there is an event for LostFocus. It is inherited from control. So without the event directly available for TextBox how do I use it? I know I could...
2
by: jd | last post by:
I have several textboxes in which the end user can enter values. When the user presses the Enter key when in any of the textboxes, or leaves that textbox, I want a routine to run (mathematical...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.