473,395 Members | 1,456 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,395 software developers and data experts.

TextChanged event firing before the KeyXXX events

Hi all,

I have a combobox control, in wich I put an autocomplete code. This code is
in the TextChanged event, but when this event fires, the Text property isn't
updated yet.

For example, if the Text property is "Foo" and I press the letter "d", the
Text property when the TextChanged event runs is "Foo". Only after the
TextChanged event be processed, the KeyDown, KeyUp and KeyPress events fires
and update the Text property.

I think it's very strange. Is it a bug? How can I get the correct Text
property in the TextChanged event?

Thanks in advance,
Fabrício de Novaes Kucinskis.
Jul 19 '05 #1
3 2901
Hi,

Can you post the code you are using? I have tried this out with .NET
framework 1.0 and the Text property returns the current text in TextChanged
event. Also at my end the KeyDown event fired before the TextChanged event.
Below is the code I tried:
Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles TextBox1.TextChanged

Console.WriteLine(TextBox1.Text)

End Sub

Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown

Console.WriteLine("fired")

End Sub

"Fabrício de Novaes Kucinskis" <fa*********@uol.com.br> wrote in message
news:eD**************@TK2MSFTNGP12.phx.gbl...
Hi all,

I have a combobox control, in wich I put an autocomplete code. This code is
in the TextChanged event, but when this event fires, the Text property isn't
updated yet.

For example, if the Text property is "Foo" and I press the letter "d", the
Text property when the TextChanged event runs is "Foo". Only after the
TextChanged event be processed, the KeyDown, KeyUp and KeyPress events fires
and update the Text property.

I think it's very strange. Is it a bug? How can I get the correct Text
property in the TextChanged event?

Thanks in advance,
Fabrício de Novaes Kucinskis.

Jul 19 '05 #2
Hallo,

"Fabrício de Novaes Kucinskis" <fa*********@uol.com.br> schrieb:
I have a combobox control, in wich I put an autocomplete code.


Does this code work?

http://www.codeproject.com/vb/net/au...e_combobox.asp

HTH,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet
Jul 19 '05 #3
Hi Herfried, Prateek,

My code is similar to the codeproject's code. I tried it (my code) in two
other computers, and it works correctly. I think the problem is my computer
(therefore I have no idea on what can do this kind of error).

I'll run the Windows Update, and try again.

Thanks for the help,
Fabrício.


"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hallo,

"Fabrício de Novaes Kucinskis" <fa*********@uol.com.br> schrieb:
I have a combobox control, in wich I put an autocomplete code.


Does this code work?

http://www.codeproject.com/vb/net/au...e_combobox.asp

HTH,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Manuel Lopez | last post by:
I have a puzzling form timer problem that I didn't experience prior to Access 2003 (though I'm not sure access 2003 is to blame). Here's the situation: a computer has two access 2003 databases on...
2
by: jorge | last post by:
Hello I have the following situation: (everything is dynamic (controls.add)) 1. Button.Init { WasButtonClickFired = true } 2. TextBox.TextChanged { WasButtonClickFired?
1
by: bill yeager | last post by:
I have two fields on my webform that I want calculated in my code-behind, but as I type in the controls, the events are not firing (as evidenced in debug mode). <code> Private Sub...
3
by: Kurt Schroeder | last post by:
I'm setting focus depenting upon which field has changed value. I'm doing this with the following: Page.RegisterStartupScript("SetFocus", "<script language=""Jscript"" >...
3
by: Fabrício de Novaes Kucinskis | last post by:
Hi all, I have a combobox control, in wich I put an autocomplete code. This code is in the TextChanged event, but when this event fires, the Text property isn't updated yet. For example, if...
1
by: Stan Sainte-Rose | last post by:
Hi, I have a problem with my textchanged and leave events I have a script in the leave event of my textbox and also in my textchanged. The script in my textchanged adds and displays a tabpage....
4
by: Jason Huang | last post by:
Hi, In my C# Windows form MyForm I have some TextBoxes. In these TextBoxes, we have to detect if the TextChanged event occurs, if there're changes in these TextBoxes, it will ask if we want to...
1
by: PromisedOyster | last post by:
1. I have a series of RequiredFieldValidators that need to be be enabled/disabled depending on what the user types into various text boxes. Can I do this using the Enabled property of the...
2
by: John Kotuby | last post by:
Hi guys, I am converting a rather complicated database driven Web application from classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The original ASP application works quite...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.