Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / November 2004

Tip: Looking for answers? Try searching our database.

Converting textbox->text to integer

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave - 29 Oct 2004 19:53 GMT
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() );

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.