Click Button Add to Value

Posted on 2006-04-05
Last Modified: 2010-05-18
I have a textbox and a button on a mobile app - what I need to do, is each time the button is click increment the numeric value, in the textbox by 1.
Question by:tbaseflug
    LVL 48

    Accepted Solution

    private void button1_Click(object sender, System.EventArgs e)
                      int i = 0;
                      i = Convert.ToInt16(textBox1.Text);
                      i +=1;
                      textBox1.Text = i.ToString();
    LVL 96

    Expert Comment

    by:Bob Learned

           private void button1_Click(object sender, System.EventArgs e)
              this.textBox1.Text = (Convert.ToInt32(this.textBox1.Text) + 1).ToString();


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now