c# - How to set focus on a textbox when I close another Form? -


i have 2 forms, form1 , form2. form2 opened button located in form1. want when close form2 x(cross) button in upper right corner of window, focus set textbox1 of form1. regarding ??

try

  private void button1_click(object sender, eventargs e)     {         form2 f = new form2();         f.show();         f.formclosed += f_formclosed;      }      void f_formclosed(object sender, formclosedeventargs e)     {          textbox1.focus();     } 

Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -