How to keep window always on top

前端 未结 3 1544
自闭症患者
自闭症患者 2021-01-16 06:35

How I can keep my window staying always on top even if there is a window of another application with Topmost = true option activated and trying to stay in front

3条回答
  •  野的像风
    2021-01-16 06:57

    Easiest way(assuming you allready have topmost promery set) would be calling

    myform.BringToFront();
    

    on FIXED but relativly small time intervals(see Timer class), through all the time form must stay on top.

    If calling this was conected to event that inform you of losing privileg of beeing on top, that could possibly cause resource-fihgts between multiple applications. Price of beeing safe is that some other program might be cheating by lisstening to informations when he is overthroned by your program, but the only solution for you wolud than be to kill that other program if you want to stay on top all the time :D

提交回复
热议问题