Tono Nam
Tono Nam

Reputation: 36050

Send window to back when activated

I found the answer to this question in here.

that solution works great when you call the method just once (don't call it from the event window activated). I am creating a gadget and I want the window to always be in the back. if the user clicks on the gadget I don't want it to come to the front which is the default behavior of windows. so what I did in order to solve that problem was to create this event:

    private void Window_Activated(object sender, EventArgs e)
    {
        SendWpfWindowBack(this);
    }

so every time the window is activate it call the method founded on the first link that I provided. the problem is that the system tray gets sent to the back. let me show you what I mean.

that is my gadget on visual studio.

enter image description here

when I run it it get's sent to the back: (I open notepad and outlook to illustrate my point)

enter image description here

now when I click on it the event window_Activated fires and it gets send to the back:

enter image description here

But note how the system tray (windows start up menu window) get's sent to the back!!!!

it still is behind everything exept the most important window wich is the windows start up menu. How can I resolve this. why is it going in front of the system tray !?

Upvotes: 0

Views: 4052

Answers (1)

Tono Nam
Tono Nam

Reputation: 36050

After 2 hours of stubbornness I figured it out... Since the window was so big for some reason that happen (gadget was bigger than entire desktop). I made it smaller and it worked.

Upvotes: 2

Related Questions