Originally Posted by
paulogrady
But will this only work for string variables??
MessageBox.Show only works with string variables. You can use the equivalent of sprintf for other variables such as ints, doubles etc. What other variables do you want to use?
EDIT:
You can go on and on with this example...
Code:
#using <mscorlib.dll>
#using <System.Windows.Forms.dll>
using namespace System::Windows::Forms;
int main(void)
{
int iInt = 10;
float fFloat = 1.23F;
System::String ^sTemp("Test 1,2,3");
MessageBox::Show(sTemp, "Test String");
MessageBox::Show(iInt.ToString(),"Test Int");
MessageBox::Show(fFloat.ToString(),"Test Float");
sTemp = System::String::Format("{0:(###) ###-####}", 8005551212);
MessageBox::Show(sTemp, "Test Format");
return 0;
}