In one project I need to have more dialog forms that are dinamicaly  
created (and destroyed) and these forms are not modal. Well, suppose I  
have 3-4 formg open and I close one of them. Form is destroyed and focus  
goes to... main form. And this is not exactly what my client will need :)  
. So the
question Is how to make so, that after closing one of these forms, the  
focus goes automaticaly to last opened form?
I have some solution but need some other point of view and may be my  
solution is wrong. Here is what I made:
   for i := 1 to Screen.FormCount - 1 do
   begin
     if (Screen.Forms[i] <> Self) and (Screen.Forms[i].Parent <> Self) and
       Screen.Forms[i].Visible and Screen.Forms[i].Enabled then
     begin
       Screen.Forms[i].SetFocus;
       HaveActiveWnd := True;
       Break;
     end;
   end;

Is it ok?
-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to