[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Click Button Add to Value

Posted on 2006-04-05
Medium Priority
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

Mikal613 earned 2000 total points
ID: 16385780
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
ID: 16391384

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


Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Integration Management Part 2
Suggested Courses
Course of the Month19 days, 22 hours left to enroll

873 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