53

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
  • 153,128
  • 77
  • 353
  • 394
SomeUser
  • 531
  • 1
  • 4
  • 4
  • 4
    I saw a glimpse of this problem with Visual Studio 2010 starting to run "Always On Top" in Windows7, but it only happened straight upon a ReSharper update, and got resolved as soon as Visual Studio was restarted. –  Sep 09 '12 at 09:43
  • 1
    Which version of Visual Studio do you refer to? – Marcel Dec 10 '13 at 10:18
  • Do you have ReSharper installed also? It seems to have a history of causing this type of issue on various versions. – panhandel Dec 31 '13 at 22:48
  • I was able to fix the problem with this: http://stackoverflow.com/a/27411034/2667554 – enn Apr 27 '15 at 09:54
  • Simple restart of visual studio 2010 helped me also. – FrenkyB Nov 19 '15 at 11:18

11 Answers11

39

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,413
  • 1
  • 11
  • 24
user281806
  • 491
  • 4
  • 5
  • 5
    This work around didn't work for me. Windows-Alt-Home seems to just tell Chrome to go to the home page. Focusing on the desktop and Windows-Alt-Home didn't seem to work either. - I run VS2010 in Admin mode - Resharper - Windows 7 I don't have a solution, just giving feedback – David Chiew Feb 05 '15 at 22:35
  • 12
    This almost worked for me; I had to press Windows+Home (I didn't know about that one) and then simply pressed Windows+Home again. Windows+Alt+Home just sent my chrome to it's homepage. So: Windows+Home -> wait for the windows to come down -> Windows+Home -> Fixed! – Nebula Dec 10 '15 at 07:26
  • As @Nebula pointed out, the ALT modifier should not be used. Confirmed fix for VS 2017 as well! :) – Johny Skovdal Jul 04 '17 at 09:17
  • Works perfectly with vs2017 – yiabiten May 13 '19 at 13:49
  • 1
    Thanks! This works with Visual Studio 2019. – ajawad987 Jul 22 '19 at 15:47
  • That has to be the strangest fix ever... but it worked on VS 2019, thank you! – sfaust Apr 08 '20 at 03:49
  • 1
    Windows+Home does nothing for me, I suspect because I have disabled the "shake a window to minimize other programs" feature. – Dave Cousineau Jul 02 '20 at 16:42
  • works with Visual studio 2022 – Anson Fong Jan 03 '23 at 23:14
6

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.

James Heffer
  • 71
  • 1
  • 1
3

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.

Bruno J.
  • 31
  • 1
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
  • 31
  • 2
  • 1
    I even didn't need to have the step of 'undocking' a tab; I just dragged it out then put it back onto the main window, and now it is good! it happened as I restarted using ReSharper 2019 – Brian Hong May 07 '21 at 17:00
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.

Rob Parker
  • 131
  • 2
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
frodeborli
  • 149
  • 3
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
  • 1
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.