How to allow copying message on MessageBox

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

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

5条回答
  •  终归单人心
    2021-02-06 20:54

    You can just use Ctrl+C while the message box has focus, but it will give you a lot more text than just the error message.

    e.g.

        MessageBox.Show("Message", "Message Title", MessageBoxButton.OK);
    

    Would copy and paste as:

        ---------------------------
        Message Title 
        ---------------------------
        Message
        ---------------------------
        OK   
        ---------------------------
    

提交回复
热议问题