你应该用NumericUpDown控件,然后用Increment属性来指定点击上下箭头时增加或减少的数量。
代码示例:
using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
///
/// NumericUpDown 的摘要说明
///
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class NumericUpDown : System.Web.Services.WebService {
[WebMethod]
public int NextValue(int current, string tag) {
return new Random().Next(Math.Min(1000, Math.Max(0, current)), 1001);
}
[WebMethod]
public int PrevValue(int current, string tag) {
return new Random().Next(0, Math.Min(1000, Math.Max(0, current)));
}
}