user1634845
user1634845

Reputation:

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.

Upvotes: 1

Views: 117

Answers (1)

SLaks
SLaks

Reputation: 888293

You can pass a Form instance as the first parameter to MessageBox.Show().

Upvotes: 5

Related Questions