-1

When the task manager is open, there is an option for "Always On Top" in the menu bar. I would like this to be the default behavior for my application. I am using C# in Visual Studio to write the program. It is basically an investment calculator that offers important numbers for the user.

The user will need these numbers and it is unlikely for them to be able to memorize them. Time is of the essence when using my application so stopping to write them all down is not feasible either. How was this implemented? Thanks in advance.

Response to proposed duplicate

I do not think this is a duplicate question. Other questions on SO have used third party software to handle this task. I also was under the impression that what others were seeking related to keeping one of many of their forms as top most. I am specifically asking to be higher than all applications running on the machine.

Furthermore, the question was designed to seek help on implementation of code to facilitate this. In the article offered by Mohammed, there is code for working with Windows API and I was unable to get it working. I had read this article prior to asking the question. Most people reported TopMost property to not help them, and many responses reported using Windows API.

halfer
  • 19,824
  • 17
  • 99
  • 186
DavidG
  • 785
  • 8
  • 23
  • I'm sorry. I actually read that post, but I was under the impression that it was only for multi form applications that I make. Not other applications as well. My application is one form. I changed the form's TopMost property to true in the properties pane and it is working. I guess that was overthought. Thank you, gentlemen! – DavidG Jul 20 '17 at 09:28

2 Answers2

2

if its winform application Form.TopMost will work

Leon Barkan
  • 2,676
  • 2
  • 19
  • 43
1

Depending on what you are using (WPF or Forms), these may help you :

The idea is to set True to the property YourForm.TopMost or YourWindow.TopMost. You may still have troubles with full screen applications that can be on top of yours.

mwryl
  • 664
  • 7
  • 16
  • 1
    *"You may still have troubles with full screen applications that can be on top of yours."* - Not restricted to fullscreen applications. **Any** application that has the `WS_EX_TOPMOST` extended window style set is fighting yours. With Task Manager being extra special, in that it always wins the battle. – IInspectable Jul 20 '17 at 10:28