How can I set focus on a Form lazarus / 3-General ---------------------------------------------------------------------- clauslack · 2009-11-05 14:21 HI, I need help from the comunity. I have a principal form (Form1), and this, I can open many form with Form.ShowModal(Form2, Form3, etc) I have a Timer1 in the principal form(Form1), that show a message box when arrive new messages for the user. All works fine when the application is maximized. But when application is minimized in a Form2 or Form3 and arrives a new message with ShowMessage, the calling form receives the focus (Form1) and then I can't access to Form2, because Form1 is disabled... A workarround is put the ShowMessage in all Forms(Form2,Form3), but is not the ideal. Any Idea? Thanks ---------------------------------------------------------------------- Leledumbo · 2009-11-06 10:48 Set WindowState to wsNormal / wsMaximize before calling ShowMessage. ---------------------------------------------------------------------- clauslack · 2009-11-06 13:03 I do it that, but not work, because ... - Form1 open Form2 in ShowModal, so Form1 is disabled, Form2 has the focus. - Minimize Form2. (this minimize all the application) - The Form1.Timer1 (every minute if there new message) display the ShowMessage. - Close ShowMessage with OK. - The ShowMessage give the focus to the calling form (Form1), but Form1 is disabled.... - Form2 is behind Form1 (both maximized) and I can not choose Form2. That is the problem. I have two workarround. - The Form1.Timer Call a Form2.ShowMessage, Form3.ShowMessage, FormN.ShowMessage so the ShowMessage give the focus to the calling form (Form2, Form3,etc) I have 30 forms, and more are added - Form1.Timer call an external executable with ShowMessage and ParamStr(1) for display the message. (the best solution for now) Summary: ShowMessage give the focus to the calling form. Thanks anyway ---------------------------------------------------------------------- zeljko · 2009-11-06 13:36 What widgetset / OS ? ---------------------------------------------------------------------- clauslack · 2009-11-06 14:04 Lazarus 0.9.27/0.9.29 fpc 2.3.1/2.5.1 Windows 2000/XP. Under Delphi I can see the Taks Bar of Form2 minimized, over Form1 disabled.