简体   繁体   中英

Calling MessageBox.Show from a separate form

I'm wondering today if there is any way to show a messagebox with a separate form as it's parent. As an example, say I have Form1 and Form2. From Form1, how do I call a messagebox to show with Form2 as the parent? In my case, Form2 is dynamically created, if that makes a difference.

您可以将Form实例作为第一个参数传递给MessageBox.Show()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM