Chrysaor
asked on
How do I display an integer into a label's text in visual c++?
I am trying this:
int x = 5;
this->label1->Text = x;
but it displays error,
error C2664: 'void System::Windows::Forms::Co ntrol::Tex t::set(Sys tem::Strin g ^)' : cannot convert parameter 1 from 'int' to 'System::String ^'
No user-defined-conversion operator available, or
No standard conversion exists from the boxed form of the arithmetic type to the target type
thanks
int x = 5;
this->label1->Text = x;
but it displays error,
error C2664: 'void System::Windows::Forms::Co
No user-defined-conversion operator available, or
No standard conversion exists from the boxed form of the arithmetic type to the target type
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
it's a common error, you try to assign an integer to a text field.
You must convert from int to String.
I don't know exactly the sintax:
this->label1->Text = x.ToString();