Why use a owner window in MessageBox.Show?

前端 未结 8 1177
我寻月下人不归
我寻月下人不归 2020-12-14 17:31

MessageBox.Show has forms like MessageBox.Show( ownerWindow, .... ).

What do I gain by assigning a owner window?

8条回答
  •  抹茶落季
    2020-12-14 17:57

    It turns out that window ownership is not transitive. In the case where you have form, spawning a form, spawning a MessageBox, The MessageBox.Show needs to use the ownerWindow parameter. The original form should be set as the owner window of the MessageBox.

提交回复
热议问题