Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make a form appear on top of all other windows?

How can I make a form appear on top of everything on the desktop, not just forms within my application. I have spent ages Googling but only found snippets for C++ and older versions of Visual Studio which no longer work. I know the answer is out there, I must be looking for the wrong thing.

Just to be clear - my project is created within Visual Studio 2012 and it is coded in Visual Basic.

Thanks in advance.

like image 608
Kez Avatar asked Mar 14 '13 14:03

Kez


2 Answers

As Steve said, this work as long as your app is the only one using it:

Me.TopMost = True

Its a property found in forms. If you are executing this outside a form, use the name of the form, for example Form1.TopMost = True.

MSDN documentation and some info you may find interesting about trying to make a window to be in top of "Top-Most" Windows.

like image 159
SysDragon Avatar answered Sep 22 '22 23:09

SysDragon


Setting TopMost to True makes it obsure other windows permanently. I found if you make it True then False, you'll bring the Form to the top so it is visible, yet other Forms can go over if they are selected.

like image 31
user5351330 Avatar answered Sep 22 '22 23:09

user5351330