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
Post a Comment