How to check if window is really visible in Windows Forms?

后端 未结 9 1349
小蘑菇
小蘑菇 2020-12-30 09:59

Normally you use Form.Visible to check if Window is visible at all. But sometimes on the screen window is below other windows so it\'s really invisible.

So how to ch

9条回答
  •  無奈伤痛
    2020-12-30 10:10

    You can call the Activate method on the form to bring it to the front if it isn't already.

    However, note that if a different program is active, it will usually simply flash the desktop button (depending where you call it from). This is Windows' standard protection against focus-stealing and you should not try to work around it.

提交回复
热议问题