C# Winforms - SendToBack Event - detect Z order change

Posted on 2011-05-09
Last Modified: 2012-05-11
I have a winform.   How can I detect if the Z order has changed or if the Form is sent to back?
I have an app with multiple windows opens. If a form is sent to back I need to sent to back one of the corresponding forms.
thx in advance
Question by:JElster
    LVL 11

    Expert Comment

    If a form is sent back then it means that it lost focus.
    Try using that event.
    LVL 1

    Author Comment

    The form does not have a Lost Focus event
    LVL 11

    Accepted Solution

    Yes, you are right. it has OnFocus, but not Lost Focus event.

    However, you can do this:

            protected override void OnDeactivate(EventArgs e)
               // your code here...
    LVL 11

    Expert Comment

    And you also have a Deactivate event...

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    In one of my recent projects, I was working with IP cameras, I need to take some pictures from the camera and do some processing on it. The first step, was to retrieve the image from camera into Image object. So that it can be displayed or …
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now