Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What would the Visual Basic code be for an Always On Top Option?

I have a Always On Top Tool Strip Menu option and I cant figure out the code that would make it stay on top of other windows when checked, and vice-versa when unchecked. Can you please help?

like image 329
Tyler Malo Avatar asked Mar 06 '12 22:03

Tyler Malo


2 Answers

To set "always on top," set myForm.TopMost = True from your menu option. See the Form.TopMost documentation.

To un-set it again, set myForm.TopMost = False.

like image 106
rob05c Avatar answered Sep 20 '22 23:09

rob05c


To toggle whether the Form is the TopMost, simply change the property Form.TopMost.

For example, to set the Form to be on top, use this:

Form.TopMost = True

To disable TopMost, use this:

Form.TopMost = False
like image 29
nullpotent Avatar answered Sep 20 '22 23:09

nullpotent