I am using Windows 11 and am wanting to keep a form above the task bar, even when the task bar is clicked. There is a lot of empty space here and would like to use this space for a program. I am using vb code in visual studio.
I have tried the timer1 method to me.focus() every second, but this does not work. Every time I click on a taskbar icon other than the program, it hides behind the taskbar.
My TopMost property is True already.
This is what has been said before but unfortunately it seems to not work.
Create a timer, then add the following code:
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles
Timer1.Tick
Me.Focus()
End Sub
2
Answers
The solution for me was the following code:
I’ve only tested this on windows 10. The taskbar on windows 11 may have a different classname.
Use Spy++ to find the right name if this doesn’t work.