This blog is a depository for things I have found regarding VB.NET and C#.NET development (and other things I may need to remember). This blog is primarily for my own reference, but if the information I found is useful to others, then that is great. If others want to contribute with comments or other information, then that is great too.
In VB6, you used a Win32API call to SetWindowPos to get a form to always stay on top. This has been simplified somewhat in VB.NET. Put the following in Form_Load or other appropriate place:
Is there any way to make a window on top of a full screen app? I know this doesn't make too much sense since the app I am working is a "window", but... basically I want my app to sit on top of another app.
Srego - Thank you for these posts. I followed the link to: http://www.vbforums.com/showthread.php?p=3249342
The solution there totally did the trick for me. Use a timer, to keep setting the form property to form1.topmost = true.
I set my timer to every 1 second, and it worked like a charm for me.
Here is the code snipet: Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Me.TopMost = True End Sub
It might, but if you add a timer control instead, and double clicks the control to generate the handler code, then set the interval to something more sensible. like every 250 ticks, then that may reduce the impact on your processor usage
12 comments:
Thanks a lot. I like it.
Is there any way to make a window on top of a full screen app? I know this doesn't make too much sense since the app I am working is a "window", but... basically I want my app to sit on top of another app.
THis seems to be a common problem if you search around on the internet. Here are some of the articles I found on it:
http://osdir.com/ml/windows.devel.dotnet.winforms/2004-06/msg00369.html
http://www.vbforums.com/showthread.php?p=3249342
http://www.codeproject.com/KB/cs/FullScreenDotNetApp.aspx
http://www.vbforums.com/showthread.php?referrerid=61394&t=525997
I don't think there is really a solution for you in any of these, but it might point you in the right direction.
Srego - Thank you for these posts. I followed the link to:
http://www.vbforums.com/showthread.php?p=3249342
The solution there totally did the trick for me. Use a timer, to keep setting the form property to
form1.topmost = true.
I set my timer to every 1 second, and it worked like a charm for me.
Here is the code snipet:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.TopMost = True
End Sub
Thank you Srego - the link to
http://www.vbforums.com/showthread.php?p=3249342
totally did the trick for me.
The answer is to use a timer, to keep setting the form topmost = true.
Here is the code snipet. Thanks so much to Srego for posting this info.
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.TopMost = True
End Sub
i think using of timer every secont to tik may kill my CPU usage and resource
It might, but if you add a timer control instead, and double clicks the control to generate the handler code, then set the interval to something more sensible. like every 250 ticks, then that may reduce the impact on your processor usage
Take a timer control, set its interval property to 1 then paste the following.
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.Focus()
End Sub
Thank God i found you, thank you
God Bless you
thank God i found you, thank you
God bless you
thank God i found you, thank you
God bless you
Thanks!it works...!
Post a Comment