The Mode window is displayed in activeform. After switching to another application and switching back, the application cannot get the focus. What should I do if the mode window is behind the application?

Source: Internet
Author: User
The Mode window is displayed in activeform. After switching to another application and switching back, the application cannot get the focus. The mode window is behind the application. What should I do? Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiAPI/html/delphi_20061112180622250.html
Shows the mode window in activeform. When switched to another application ProgramAfter switching back, the application cannot get the focus. The mode window is behind the application. What should I do?

I guess there is no experiment. I don't know if the parent form or owner form of the form is specified. Can this solve your problem.

I have encountered such a problem and cannot solve it all the time.
The upstairs method has been tried. If there is a problem, after specifying the parent form of the mode window, the child form cannot get the focus.

It seems that when the form is displayed, it must be displayed on the top;
Use showmodal;

You can control the mouse over this window.

Note that the parent attribute of your mode window is set as follows:
In an event of activeform
Showform: = tshowform. Create (Self );
Showform. Parent: = self;
Showform. showmodel;

Similarly, MessageBox () is also the case. If handle is set to self. Handle, this will not happen.

Have you tried it upstairs? It doesn't work at all. Once you execute showmodal, the main form including OCX will not respond to the focus.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.