auto increment numbers in c# windows app [duplicate]
Possible Duplicate:
auto generating numbers
how to increment a numbers in textbox control in c# windows app.samples like s001 and should be increment always when i come to form it should be like s002.where should i have to write a code either in textbox or forml_load event开发者_如何学Go.
You can use following code at an appropriate place in your form to increment TextBox's value by one:
TextBox1.Text = String.Format("{0:000}", Int32.Parse(TextBox1.Text) + 1);
You must write the code in Form_load event and the number must be publicly define...
each time to load the form the textbox text must be loaded with new value.
精彩评论