Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Integers and Text Boxes.

Status
Not open for further replies.

Bongo2k

Technical User
Apr 20, 2005
5
GB
Im having major problems getting a text box to display my integers. Ive declared the variable as a integer and set it to 0, but whenever i try and set the text of a text box to the variable name i get: Form1.h(762): error C2664: 'void System::Windows::Forms::TextBox::set_Text(System::String __gc *)' : cannot convert parameter 1 from 'int' to 'System::String __gc *'. Now i know what the error means, it cant convert a number to a letter. But i set the variable as a letter! Its been annoying me alot. Can anyone help?
 
Have you added a control variable to your edit box?
If you haven't, right click on the edit box and click add class. If you have, perhaps you should use the _itoa() function.

Hope that helps
 
i havne't tried this, but you might be able to cast the int to char *... not sure if it willl work...

int a=0
char * b= new char [100]
b=(char *) a;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top