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

x
?
Solved

Click Button Add to Value

Posted on 2006-04-05
2
Medium Priority
?
210 Views
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.
0
Comment
Question by:tbaseflug
2 Comments
 
LVL 48

Accepted Solution

by:
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();
            }
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16391384
Or:

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

Bob
0

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