How to prevent a new WPF form from stealing focus?

后端 未结 3 1812
清歌不尽
清歌不尽 2020-12-03 10:07

I have written a simple MSN-style program that will send and retrieve messages using WCF. The main form contains a Textbox to type in the message to be sent. In the backgrou

3条回答
  •  没有蜡笔的小新
    2020-12-03 10:35

    The answer is simple: Since .NET 3.5 SP1 WPF forms have a ShowActivated property. Set this to false and any form thus marked won't steal no focus no more!

提交回复
热议问题