C# & VB.NET School Support

Moderators: None (Apply to moderate this forum)
Number of threads: 138
Number of posts: 231

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

Report
textBox and data types Posted by TheSky on 27 Jul 2003 at 1:03 AM
I'm very beginner.
Can I manage integer or date type from a textBox input?
thanks.
Pedro

Report
Re: textBox and data types Posted by frazrasheed on 29 Jul 2003 at 12:05 AM
As far as i have got your point, you want to ask whether you can get integer or inputs of other data type from a text box. The answer is offcourse you can!

The text in the text box is in the string form and can be got from its Text propery. For example if you have a text box instance with the name txtMyAge which has some integer value then you can get it using the following code

int age = int.Parse(txtMyAge.Text);

In the above code we have used the Parse() method of int32 class which is the underlying class of the int data type in C#. The Parse method parses the supplied string and attempt to cast it in the integer type.

I hope it helped!

Thanks and Bye for now
Faraz


: I'm very beginner.
: Can I manage integer or date type from a textBox input?
: thanks.
: Pedro
:
:

Report
Re: textBox and data types Posted by TheSky on 8 Aug 2003 at 2:27 PM
Your help was very useful. Thanks.
TheSky

: As far as i have got your point, you want to ask whether you can get integer or inputs of other data type from a text box. The answer is offcourse you can!
: [snip]
: Faraz
:




 

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.