开发者

Windows Forms: Modeless ShowDialog?

开发者 https://www.devze.com 2023-02-08 17:03 出处:网络
What could be the reason, that a winforms-form, which is ope开发者_如何转开发ned with ShowDialog() (no parameters), appears modeless (I can still select the parent window)? Maybe it has something to d

What could be the reason, that a winforms-form, which is ope开发者_如何转开发ned with ShowDialog() (no parameters), appears modeless (I can still select the parent window)? Maybe it has something to do with a backgroundworker in the parent window? When I use this as parameter I get a cross thread exception.


Do you open it from thread that owns main window ?


Short answer: yes.

The only possible way that I can think of having a 'modeful' ShowDialog is if you're opening from a BackgroundWorker. The fact that references to this give you cross thread exceptions is a kind of hint that you're doing something wrong...

0

精彩评论

暂无评论...
验证码 换一张
取 消