delphi - How to stop a UI from locking up when a second form is shown? -
I have a chat program in Delphi 7. As a special "effect" we show some bullet holes, when a special firing sound file is played. We did this by creating a new look in the shape of the bullet hole BMP image file, for which some seconds of delay will appear and then fade.
All this works, however, while bullet hole images are on-screen, the program is effectively locked ... when the last of the images disappears, the focus returns to the user.
My programmers are not well aware of graphics and believe that it only requires you to pay for this price, but I hope this is not true at all. Any suggestions randomly display tablet holes images on the screen?
It is hard to say without seeing the code and to know what your opening is / the second form is loading, but it seems that You are opening them with ShowModal , which will lock the form until there is no result initially.
If this is the case, you can simply open it with the show method and then set the focus back to the main form.
Process TForm1.Button1Click (Sender: Tubbed); Var obj: TForm2; Start obj: = TForm2.Create (zero); Try obj.FormStyle: = fsStayOnTop; Obj.show; Self.SetFocus; // Set focus back to form 1 except foreendle (obz); End; End; In the above version also it has been said that you are forming dynamically form in sequence and the second form is responsible for freeing yourself.
Comments
Post a Comment