473,320 Members | 1,846 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,320 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 3168
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
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.