Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我今天想知道是否有任何方法可以显示带有单独表单的消息框,因为它是父级。例如,假设我有 Form1 和 Form2。从 Form1 中,如何调用消息框以显示 Form2 作为父级?在我的情况下,Form2 是动态创建的,如果这有所不同的话。
您可以将Form实例作为第一个参数传递给MessageBox.Show().
Form
MessageBox.Show()