56

My copy of Visual Studio seems to be set in "Always On Top" Mode. It runs this way by default; there seems to be no way of changing it.

Visual Studio runs as Administrator/Elevated, but that really shouldn't affect whether or not Visual Studio runs as "Always On Top."

Any idea why this may be occurring, and how to prevent it from happening?

DavidPostill
  • 162,382
SomeUser
  • 561

11 Answers11

42

I had a similar thing happen with Visual Studio being stuck as always on top. It started happening after I hit the Windows key followed by a bunch of arrow/home/end/pageup/pagedn keystrokes by accident (I had meant to use the control key).

What seemed to clear the always-on-top behavior was to select a different application (eg: Chrome), then press Windows+Home (which minimized everything other than Chrome), then press Windows+Home again. Then I could un-minimize Visual Studio, and it would no longer be always on top.

This worked with VS2010, VS2012 and VS2013 when they got into this weird always on top mode.

Edit: revised based on comment from @Nebula

bugybunny
  • 1,503
7

Save your work, close Visual Studio, reopen it. Hit start, or debug, or hit F5.

This worked for me.

Very strange though, for months I didn't have this problem, and earlier when I started debugging, my window was behind Visual Studio's window... Thought it strange as it never happened before. Closed Visual Studio, reopened it, and viola.

4

Fixed the issue with VS2017 on Windows 10 by giving focus to another application and pressing Windows+Home (to minimize all windows apart from the one which got focus) and then Windows+Home again to restore all other windows (including VS) and this time VS wasn't always on top anymore.

3

In my case, I was able to get it out of that mode by using Window->Float to undock a tab. After I dragged the tab back onto the main window, it was no longer stuck on top.

Jtbs
  • 131
3

I ran into this with Visual Studio 2019 (on Windows 10). I'm not sure quite how it started, but I do use ReSharper. Closing and restarting VS2019 did not work. I also installed a minor update (probably before restarting VS; I'm not sure if this might have actually locked-in the always-on-top behavior or made no difference--probably the latter, but I mention it just in case). I tried the various solutions here and in other linked pages and none seemed to help (I might not have hit all of them; some were more involved or meant for older versions or otherwise hard to try).

Finally, on a whim, I tried launching a second instance of VS 2019--since they can't both be on top at the same time--and after minimizing the first instance to get to the second, I found that the new instance did not force itself on top of other windows. I closed out the first instance and then re-opened my solution in the new instance, and it no longer forces itself on top. I just checked that it stays fixed after restarting VS 2019 also.

Update: This can help turn off the always-on-top state at a particular time, but it doesn't prevent it from potentially happening again. I'm not sure what causes it, but VS does get back into being always-on-top from time to time when a new VS instance is started. So, it's a temporary but not permanent fix.

2

Perhaps an addin is causing it? Try disabling addins in Tools/Add-in manager then run Visual Studio in safe mode by executing

devenv.exe /safemode
2

Use windowdetective to check if it's actually set to always ontop Work from there to determine the cause.

1

The "good ol' close & reopen" method will resolve this issue silently. Just save your work, close Visual Studio and reopen your project/solution and this unintended setting will go away. Cheers!!

yyardim
  • 11
0

When I got this problem I found a solution to the reverse problem over at How-To Geek. Luckily it involved a TOGGLE which I could use to disable the always on top mode that Visual Studio's window had gotten into. As per the above link, I added this to my AutoHotkey script

^SPACE:: Winset, Alwaysontop, , A

and then I selected Visual Studio's window and used ctrl-space to toggle always on top. It worked like a charm.

0

Restarting Visual Studio 2015 fixed the problem.

In my case, VS switched in "Always On Top" mode while I was using intellisense from ReSharper.

0

Maybe for some reason, the always-on-top property of your Visual Studio (VS) is being saved somewhere and then reloaded on run.
Depending on your VS version, you may be able to use FileBox eXtender(FBX) to change its always-on-top property for each run or permanently. It is probably better to use the version matching your Windows' architecture; 64-bit for x64 and 32-bit for x86. Also, FBX can probably be only used for elevated-mode programs if itself is run in elevated mode (e.g. "Run as Administrator").
Always-on-top status can be switched by clicking the pushpin on the program title bar when FileBox eXtender is running.