关于:MessageBox.Show()
C# code
int sum;
MessageBox.Show("这里有变量sum,", "google", MessageBoxButtons.OK, MessageBoxIcon.Warning);
弹出的对话框里显示 sum 的值,而不是字符“sum”
如何实现呢?
------解决方案--------------------int sum=100;
MessageBox.Show(string.Format("这里有变量{0},",sum), "google", MessageBoxButtons.OK, MessageBoxIcon.Warning);
------解决方案--------------------MessageBox.Show(string.Format("这里有变量"+sum,), "google", MessageBoxButtons.OK, MessageBoxIcon.Warning);