if i click button first time I want display number 1 on textbox,
again if i click button second time display 2
keep on clicling number will increse
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Oct 12, 2012, 6:19 AM
private int number = 0;
private void button1_Click(object sender, EventArgs e)
{
number++;
textBox1.Text = number.ToString();
}
Marish BalasubramanianPosted Oct 12, 2012, 6:17 AM
if(TextBox1.Text=="")
{
TextBox1.Text="1" ;
}
else
{
TextBox1.Text=int.parse(TextBox1.Text)+1;
}