0

I have two text box

Textbox1and Textbox2 and button1
textbox1.text = 1;
textbox2.text = 0;

Now I want when I click on button1.textbox2's data increment. this is my code

for (int i = 0; i <= 5; i++)
            {
                textBox2.Text = textBox1.Text[i].ToString();
                
            }
5
Contributors
5
Replies
8
Views
6 Years
Discussion Span
Last Post by ddanbe
0

try this

for (int i = 0; i <= 5; i++)
 {
   textBox1.Text = i.ToString();
   textBox2.Text = TextBox1.Text;
 }
0

I am Retrieving Studentid from sql and show in textbox1.its Show right.but I want if textbox1's text is 10000data show of textbox1 after increment 1.
as a 10001.
Example
Textbox1 Loop Texbox2
10000 +1 10001

0

u should do it like this,on button click event.
int i=convert.toint32(tex1.text);
text2.text=i+1;

0

Are you looking for something like this?

private void button1_Click(object sender, EventArgs e)
        {
            // augment txbox1 value and put in txbox2
            int id =int.Parse(this.textBox1.Text);
            ++id;
            this.textBox2.Text = id.ToString();
            // if txbox1 contains 10001, txbox2 will now contain 10002
        }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.