Always On Top Property At Runtime

By | 2019-08-27

If you paste this code to your Form will have a new form property which when set to true will keep you window (form) above all other open windows even when it does not have the focus.

One issue with it is that it might work or might not work in the IDE. I’ve seen both cases. It also does not work for MDI children.

Pay attention to the commented form resize code. If you window can be minimized it will lose the setting so you will need to uncomment the resize code to make sure that it is restored properly. Happy coding.

Attachments

FileUploadedSize
989-20190827-094446-AlwaysOnTop.txt8/27/2019 9:44:46 AM850
Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.