Reputation: 4151
Let's say I have some threads running there. They must perform some actions only if no modal forms shown over main form.
I don't want to add hack checks like setting some flag before opening some modal form. Is there any generic way?
Upvotes: 0
Views: 29
Reputation: 24903
We use this hack:
if (this.Visible && !this.CanFocus)
{
//another modal window is opened
}
But you should know, that modal window "blocks" main form execution. And you can check this only in some cases, like repainting.
Upvotes: 1