By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 1,302 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

keep application on top

100+
P: 175
In Visual Basic, how do I keep a program that I'm running on top of EVERYTHING? For example, I have an application in Visual Basic that has a GUI, and I want it to stay on top of anything that may open after it.

I searched the internet, found a bunch of things, and NONE of them work. If anyone can help me out I would appreciate it.
May 7 '07 #1
Share this Question
Share on Google+
2 Replies


Dököll
Expert 100+
P: 2,364
In Visual Basic, how do I keep a program that I'm running on top of EVERYTHING? For example, I have an application in Visual Basic that has a GUI, and I want it to stay on top of anything that may open after it.

I searched the internet, found a bunch of things, and NONE of them work. If anyone can help me out I would appreciate it.
Greetings, manontheedge!

If I read correctly, it sounds like all you need to do is to make the other forms disappear:

ThisForm.Visible = False

ThatForm.Visible = True

Dököll
May 8 '07 #2

SammyB
Expert 100+
P: 807
In Visual Basic, how do I keep a program that I'm running on top of EVERYTHING? For example, I have an application in Visual Basic that has a GUI, and I want it to stay on top of anything that may open after it.

I searched the internet, found a bunch of things, and NONE of them work. If anyone can help me out I would appreciate it.
In VB.NET, the form has a TopMost property to do that.
Expand|Select|Wrap|Line Numbers
  1.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2.         Me.TopMost = True
  3.     End Sub
In VB6 and VBA, you need to use an API call, but I've forgotten what it is. I'll look at my code and post it tomorrow.
May 8 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.