Is there any simple way to make a method that gets called whenever the user clicks out (or changes fo开发者_开发百科cus 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!
Try Control.OnLostFocus
, which occurs whenever the control loses focus.
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.
精彩评论