The best way to do this is to create the string before-hand, and use that string in the Console.WriteLine and the MessageBox.Show().
ie:
To keep the formatting of your string, you can do:Code:string myString = "foobar"; Console.WriteLine(myString); MessageBox.Show(myString, ...);
Code:int myInt = 1; string myString = string.Format("Foobar: {0}", myInt); Console.WriteLine(myString); MessageBox.Show(myString, ...);




Reply With Quote