tags:

views:

50

answers:

2

Is there any simple way to make a method that gets called whenever the user clicks out (or changes focus in some other way) from a text box in C#? I'm not really familiar with the way events are handled in C# - I rely on double-clicking a control to automatically generate the btn_Button_Click method.

Thanks!

+5  A: 

Try Control.OnLostFocus, which occurs whenever the control loses focus.

John Feminella
Thank you, works just fine!
Nikolai
+2  A: 

You can get a list of events in the properties window for the control. If its not already visible, display the properties window from the view menu. Then select the control you want to add an event to, click the lightning bolt in the properties window (shows events) and add the event you need.

brian