开发者

Check Form for child Forms - C#

I have main form and some other forms, that can be shown by controls, placed on the main form, using ShowDialog(control). Also I have event handler on the m开发者_开发问答ain form, that can be handled anytime. How can I check inside it, is there any other dialog forms?


If I understood your question correctly, I would suggest you to check form.visible for each form.

This might help you


You might want to have a look at the Application.OpenForms. You can have a look in the collection.


If I understand you correctly, you're asking if inside your main form's event handler, you can check to see if any other forms are open.

If you show these forms using ShowDialog then your main form's thread is blocked until that new form is closed. I believe any events fired during that time will wait, and be handled after the form closes.

If you show these forms using Show then you need to keep some reference to the form in order to check on them during your event handler.

If you word your question a little clearer, maybe I can help more.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜