Last post Apr 22, 2009 04:54 PM by Johncy
Apr 22, 2009 08:02 AM|D3NN15|LINK
(Im using Visual studio 2008 C++)
I read out the mouse position from a picture box, and i want to put it in a textbox.
This is the code i have:
test1 = pictureBox2->MousePosition.X;
_itoa_s (test1, test2, 10);
this->textBox3->Text = test2;
And the error i get:
cannot convert parameter 1 from 'char ' to 'System::String ^'
1> Reason: cannot convert from 'char *' to 'System::String ^'
Does someone know whats wrong with that??
Apr 22, 2009 09:48 AM|SurendraKishore|LINK
try out Convert.ToInt16(test2) instead of test2 for the function you are passing.
Apr 22, 2009 04:26 PM|D3NN15|LINK
I dont want to convert a string to a int.
i want a int to string so i can put it in the textbox
Apr 22, 2009 04:33 PM|gkumar85|LINK
Have you tried to use Test2.ToString() for displaying as a string.
Apr 22, 2009 04:54 PM|Johncy|LINK