Create a Modeless Messagebox

后端 未结 7 1481
难免孤独
难免孤独 2021-02-07 01:00

How might one go about creating a Modeless MessageBox? Do I have to just create my own Windows Form class and use that? If so, is there an easy way of adding a warning icon (rat

7条回答
  •  被撕碎了的回忆
    2021-02-07 01:43

    You'll have to create a Form and use Show() to display it Modeless. MessageBox.Show(...) behaved Modal as seen in the example by ghiboz; "Description of the message" is displayed until the user presses a button.

    With MessageBox.Show(...) you get the result as soon as the messagebox is closed; with a modeless message box, your code will have to have a mechanism such as an event to react when the user eventually selects something on your message box.

提交回复
热议问题