C
C#8mo ago
Shinigami

❔ WinForms Topmost property not working as intended.

Hi, I've create a basic forms app which will block the user's screen, the app's window state is maximized, and top most property is set to true. When i try to do alt tab, I'm able to switch to other applications sometimes and some times I'm not able to switch as intended. What could be the issue causing this inconsistency?
4 Replies
Will
Will8mo ago
what are the applications that let you alt tab in to them? some of them could have things like dialogs open etc that windows might deem more important than your app though i've also noticed that setting an application to be always on top can be janky, one app i use won't permanently stay on top until i minimize&maximize it
Shinigami
Shinigami8mo ago
I do have multiple apps floating around, but none of them have dialogs open For example excel, file explorer, notepad No dialogs though It's super annoying that the topmost property works for some time and then stop altogether and again starts working at some point This inconsistency is kinda unreliable Not sure if i can do anything to fix it though
Will
Will8mo ago
not sure, you might have to do something hack-y involving windows apis, eg a timer checking what GetActiveWindow() is and if it's not your app then setting your app to the foreground
Accord
Accord8mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.