Search code examples
c#stringmessagebox

How can I replace text of MessageBox (title,caption) with defined string?


I am trying to insert defined string to this code at places "paragraph" and "title" to replace them with text, which is defined in the strings, because I dont wanna write it in there, but I dont know how to do it:

*

MessageBox.Show("paragraph", "title",MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk);

* // Definitions

string dart = "Luke, I am your father"
string luke = "NOOOOOOOOOOOOOOOOO!!!!"

* how can I make the MessageBox show the text from defined string ? I hope it's clear... - Benedikz


Solution

  • It will be like this,

    MessageBox.Show(dart , luke,MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk);