Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

textBox and data types

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

Comments

  • frazrasheedfrazrasheed Member Posts: 18
    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
    :
    :

  • TheSkyTheSky Member Posts: 2
    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
    :

Sign In or Register to comment.