5

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.

Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
Kez
  • 258
  • 1
  • 4
  • 14
  • 2
    Perhaps you haven't found an answer because there is no a failproof answer? For example, what happen when another application decides the same thing? – Steve Mar 14 '13 at 14:33
  • You may want to take a look at this thread --> http://stackoverflow.com/questions/7434638/force-window-to-be-above-already-top-most-windows-like-the-task-manager – Gojira Mar 14 '13 at 14:57

3 Answers3

11

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.

SysDragon
  • 9,692
  • 15
  • 60
  • 89
  • I thought that only applied to forms within the same application - I was totally wrong! Thanks ever so much, that works perfectly. – Kez Mar 14 '13 at 15:46
1

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.

0
Me.TopMost = True

BUT in ACTIVATED (not in LOAD EVENT)

Private Sub frm_Activated(sender As Object, e As EventArgs) Handles Me.Activated

    Me.TopMost = True
End Sub
R.Alonso
  • 989
  • 1
  • 8
  • 9