开发者

auto increment numbers in c# windows app [duplicate]

This question already has answers here: Closed 12 years ago.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜