Could someone tell me how I go about converting textbox->text to and integer
value?
Thanks
Dave
Jochen Kalmbach - 29 Oct 2004 21:23 GMT
Hi Dave,
> Could someone tell me how I go about converting textbox->text to and
> integer value?
int i = Int32::Parse(textbox->get_Text());

Signature
Greetings
Jochen
My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Peter van der Goes - 29 Oct 2004 23:00 GMT
> Could someone tell me how I go about converting textbox->text to and integer
> value?
>
> Thanks
>
> Dave
What type of C++ project are we talking about?
atoi() comes to mind.

Signature
Peter [MVP Visual Developer]
Jack of all trades, master of none.
Dave - 31 Oct 2004 20:27 GMT
The Int32::Parse() worked great. Thank you.
I tried the atoi() but got errors because the value passed from
textbox->text is System::String __gc * and atoi needs const char *.
Everything I tried gave me an error because of the String __gc * conversion.
Thanks again for the help.
Dave
> Could someone tell me how I go about converting textbox->text to and
> integer value?
>
> Thanks
>
> Dave
Bil Muh - 02 Nov 2004 13:45 GMT
Visual C++ .NET
Int32 i32Variable = Convert::ToInt32( textBox1->Text->Trim() );