Results 1 to 2 of 2

Thread: Really silly question (but still I need some help) [Resolved]

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2002
    Location
    The Big D
    Posts
    310

    Resolved Really silly question (but still I need some help) [Resolved]

    I have a TextBox called userAge. Assuming the user enters 40 in the textbox, how do I convert the string "40" into a number? I tried (int)userAge.Text but that of course fails.

    What am I missing here?

    Actually got it

    Int32.Parse(userAge.Text) does the trick.
    Last edited by VBGuy; Feb 25th, 2005 at 01:48 PM.

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: Really silly question (but still I need some help) [Resolved]

    Quote Originally Posted by VBGuy
    I have a TextBox called userAge. Assuming the user enters 40 in the textbox, how do I convert the string "40" into a number? I tried (int)userAge.Text but that of course fails.

    What am I missing here?

    Actually got it

    Int32.Parse(userAge.Text) does the trick.
    if your datatype is int then I think you should just use int.Parse()
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width