Hi!
i am taking one label, one Textbox, one button. in my label text is 150.
my aim i enter text in textbox and click button, that label shows a value is 149. and again i enter text in textbox and click button also decrease one value from label i.e., this time 148. similarly.
How to Write the code to do it. please can u provide a code todo this.
Thanks.
Decrease the value in label when i click button.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Vladimir Nani29 reputationPosted Apr 22, 2010, 5:34 AM EDT
Add button and label to form.
ushort val;
public Form1()
{
InitializeComponent();
val = 150;
label1.Text = val.ToString();
}
private void button1_Click(object sender, EventArgs e)
{
val--;
label1.Text = val.ToString();
}
ArshadRank #2,492 · 564 reputationPosted Apr 25, 2010, 12:58 PM EDT
code i.e given above it correct but better you implement this logic in javascript. if your requirement is like that then no issue.