How to allow copying message on MessageBox

后端 未结 5 1805
無奈伤痛
無奈伤痛 2021-02-06 20:52

How can I allow selecting and copying of text from MessageBox in WPF?

5条回答
  •  渐次进展
    2021-02-06 21:13

    I did it this way:

    string msgtext = "message text";
    if (MessageBox.Show(msgtext, "bla bla bla. (OK to copy)", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK)
      { Clipboard.SetText(msgtext); }
    

    It works pretty good.

提交回复
热议问题