Click here to Skip to main content
15,900,973 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have a UserControl that contain TextBox's. I want to register to LostFocus of the UserControl, that mean that if the user press out of my UserControl the event should be called.How can I do this?
Posted
Comments
sumit_kapadia 9-Aug-13 2:45am    
What do you mean by user control... a Div or Table or other HTML Controls
you can set onblur property of main Div of your user control
[no name] 9-Aug-13 3:52am    
What is your user control containing?
Member 8390746 9-Aug-13 4:28am    
A textbox and listbox. when doubleclick on textbox listboxs items are showing under the text box and if I select one item from the list box listbox visible property is set to false.
[no name] 9-Aug-13 4:59am    
So where you lost the focus?
Member 8390746 9-Aug-13 5:07am    
When I doubleclick on textbox and the list is showing, now I dont want to select any item and I clicked anywhere in the page, I want to set the listbox.visible=false

1 solution

UserControl doesn't but Window have a Event called "Deactivated". So if user press out of that window, you event will be fired.
That served my purpose. Can try.. (y)
 
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