Click here to Skip to main content
15,892,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello........

I am beginner in c# programming, want to know when we feed a text box then which event occurs and how does it work. Kindly explain it in detail.......

Soon reply will be appreciated.....!!!!

Thanks...
Posted

Like most other .NET controls, Textbox has a large number of possible events, many of which will not be relevant to your question. The problem is that it is difficult to answer precisely because we do not know what you are trying to do, and this don't know which events to concentrate on.

However, the ones you are probably most interested in are:
Enter         Fires when the user input focus goes to the text box
KeyDown       Fires when the user presses a key down
KeyPress      Fires when the user has pressed a key
KeyUp         Fires when the user releases a key
Leave         Fires when the text box loses focus (i.e. when the input goes to another control)
TextChanged   Files when the Text property of a texbox changes
Validated     Files when teh text box content has been validated as ok
Validating    Files when the text box content needs to be checked.


And if you tab into a text box, type a "1" and tab out, they occur in this order:
Enter
KeyDown
KeyPress
TextChanged
KeyUp
Leave
Validating
Validated
 
Share this answer
 
TextChanged event Occurs.

If you want to know more about events please go through the below links
http://msdn.microsoft.com/en-us/library/aa645739(v=vs.71).aspx[^]
Events and event handling in C#[^]

If you want to create custom events below links helps you
Creating advanced C# custom events[^]
http://stackoverflow.com/questions/6644247/simple-custom-event-c-sharp[^]

hope this helps
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900