C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2720
Number of posts: 5746

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
get info from text box Posted by superjoe30 on 13 Apr 2005 at 9:18 PM
This may sound dumb, it's 'cause I'm new to C#.

I have a text box: txtInput
The user enters a value: 3.1415926535
I have a variable: double value

I need value to equal what the user entered, but I get a "Cannot convert string to double" error when I do this: (double) txtInput.text

Help appreciated. Thanks.


_____ __________ _____
_____-SUPERJOE30-_____
__-Superjoe Software-__

Report
Re: get info from text box Posted by nikhil500 on 14 Apr 2005 at 5:08 AM
: This may sound dumb, it's 'cause I'm new to C#.
:
: I have a text box: txtInput
: The user enters a value: 3.1415926535
: I have a variable: double value
:
: I need value to equal what the user entered, but I get a "Cannot convert string to double" error when I do this: (double) txtInput.text
:
: Help appreciated. Thanks.
:
:
: _____ __________ _____
: _____-SUPERJOE30-_____
: __-Superjoe Software-__
:
:



Use Double.Parse() method.

value = Double.Parse(txtInput.Text);

Report
Re: get info from text box Posted by superjoe30 on 14 Apr 2005 at 8:04 PM
: : This may sound dumb, it's 'cause I'm new to C#.
: :
: : I have a text box: txtInput
: : The user enters a value: 3.1415926535
: : I have a variable: double value
: :
: : I need value to equal what the user entered, but I get a "Cannot convert string to double" error when I do this: (double) txtInput.text
: :
: : Help appreciated. Thanks.
: :
: :
: : _____ __________ _____
: : _____-SUPERJOE30-_____
: : __-Superjoe Software-__
: :
: :
:
:
:
: Use Double.Parse() method.
:
: value = Double.Parse(txtInput.Text);
:
:
Oh, like Java. Ok, thanks.


_____ __________ _____
_____-SUPERJOE30-_____
__-Superjoe Software-__





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.