C#domainUpDown1如何设置点上下箭头的值

2024-12-01 01:51:02
推荐回答(2个)
回答1:

你应该用NumericUpDown控件,然后用Increment属性来指定点击上下箭头时增加或减少的数量。

回答2:

代码示例:

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)));
}

}