1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Sum of form entries

Discussion in 'C#' started by flxbbs, Sep 8, 2010.

  1. flxbbs

    flxbbs New Member

    Joined:
    May 5, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hello!
    I'm a beginner C# programmer, I just want to know how would I go around writing a script that adds digit entered in a form?:undecided
     
  2. dotNet Zombie

    dotNet Zombie New Member

    Joined:
    Aug 28, 2010
    Messages:
    34
    Likes Received:
    10
    Trophy Points:
    0
    Occupation:
    .Net Developers
    Location:
    Minnesota
    Home Page:
    something like this

    Code:
    int x = 0;
    foreach (char c in textBox1.Text)
    {
          x += Convert.ToInt32(c.ToString());
    }
     MessageBox.Show(x.ToString());
    
     
    shabbir likes this.
  3. chwax

    chwax New Member

    Joined:
    May 4, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    network admin
    Location:
    Africa kenya
    first gotta read welcome to c# then start workin
     

Share This Page