[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2000
  • Last Modified:

C# Winforms - SendToBack Event - detect Z order change

Hi..
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
0
JElster
Asked:
JElster
  • 3
1 Solution
 
saraganiCommented:
If a form is sent back then it means that it lost focus.
Try using that event.
0
 
JElsterAuthor Commented:
The form does not have a Lost Focus event
0
 
saraganiCommented:
Yes, you are right. it has OnFocus, but not Lost Focus event.

However, you can do this:

        protected override void OnDeactivate(EventArgs e)
        {
            base.OnDeactivate(e);
           // your code here...
        }
0
 
saraganiCommented:
And you also have a Deactivate event...
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now