molla2005b Posted March 14, 2016 Posted March 14, 2016 Hi , i would like to Return Focus To Previous Form Controls after close the Top(Modual) Form: ex : I Open Form1 and Open Form2 Thru Form1.I want to return Focus to Form1 control After Close Form2 I try with setFocus and WebFocus and UniSession.AddJS and SetActivate but not work. I upload a test case Download Best regards. Quote
Sherzod Posted March 14, 2016 Posted March 14, 2016 Hi, For now try: For example: procedure TMainForm.UniButton1Click(Sender: TObject); begin UniForm1.ShowModal ( procedure(sender:TComponent;Res:Integer) begin //ed1.WebFocus; UniSession.AddJS('setTimeout(function(){'+ ed1.JSName +'.focus()}, 100)'); end ); end; Best regards. 1 Quote
molla2005b Posted March 15, 2016 Author Posted March 15, 2016 Big Thanks Delphi DeveloperIt is work perfectly .... Quote
leandroavila74 Posted April 5, 2017 Posted April 5, 2017 Hi, For now try: For example: procedure TMainForm.UniButton1Click(Sender: TObject); begin UniForm1.ShowModal ( procedure(sender:TComponent;Res:Integer) begin //ed1.WebFocus; UniSession.AddJS('setTimeout(function(){'+ ed1.JSName +'.focus()}, 100)'); end ); end; Best regards. I'm having problems using mobile, In mobile setfocus is not working I tried using this method but in mobile it does not work Leandro Quote
Sherzod Posted April 5, 2017 Posted April 5, 2017 Hi, Can you make a small test case?! Best regards. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.