I have a winform tool window in C# with TopMost = true
, running on XP, being shown from within an Excel add-in. When the form is shown, I hit Alt+Tab, it brings me back to Excel. If I hit Alt+Tab again, I would expect it to bring me back to my form, but it goes to the next window (in this case, Visual Studio). Any subsequent Alt+Tab invocations alternate between Excel and Visual Studio. Additionally, if I Alt+Shift+Tab, it will go back to my form (so it's still part of the order, just the order isn't what I want it to be).
If I simply set TopMost = false
, everything works as expected. I just reproduced this with a brand new empty project — literally the only thing I did was make a TopMost form. It appears to be isolated entirely to the TopMost property.
Naturally, I'd like Alt+Tab to work the way I expect it to. Any ideas?