Windows Forms: Modeless ShowDialog?
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...
精彩评论