c#如何实现textbox1.Text输入0-500的值之后,点击button才有效。
我想问一个问题只有当这个有基本尺寸有输入为0-500时,这些按钮的功能才被触发应该怎么实现啊?...
我想问一个问题 只有当这个有基本尺寸有输入为 0-500时 , 这些按钮的功能才被触发 应该怎么实现啊?
展开
1个回答
展开全部
public class ScoreDecide
{
private double excellent;
/// <summary>
/// 优秀成绩,可根据情况不同进行配置,默认80
/// </summary>
public double Excellent
{
get
{
return this.excellent;
}
private set
{
this.excellent = value;
}
}
private double ordinary;
/// <summary>
/// 一般成绩,可根据情况不同进行配置,默认60
/// </summary>
public double Ordinary
{
get
{
return this.ordinary;
}
private set
{
this.ordinary = value;
}
}
/// <summary>
/// 默认值设定成绩分差线
/// </summary>
public ScoreDecide()
{
this.Excellent = 80;
this.Ordinary = 60;
}
/// <summary>
/// 配置成绩分差线
/// </summary>
/// <param name="excellent">此值设定优秀成绩线</param>
/// <param name="ordinary">此值设定一般成绩线</param>
public ScoreDecide(double excellent, double ordinary)
{
this.Excellent = excellent;
this.Ordinary = ordinary;
}
/// <summary>
/// 对分数进行判定,确定成绩
/// </summary>
/// <param name="grades">成绩值</param>
/// <returns>成绩等级:“优秀”,“一般”,“差”</returns>
public string DetermineGrades(double grades)
{
return grades >= this.Excellent ? "优秀" :
grades >= this.Ordinary ? "一般" : "差";
}
}
{
private double excellent;
/// <summary>
/// 优秀成绩,可根据情况不同进行配置,默认80
/// </summary>
public double Excellent
{
get
{
return this.excellent;
}
private set
{
this.excellent = value;
}
}
private double ordinary;
/// <summary>
/// 一般成绩,可根据情况不同进行配置,默认60
/// </summary>
public double Ordinary
{
get
{
return this.ordinary;
}
private set
{
this.ordinary = value;
}
}
/// <summary>
/// 默认值设定成绩分差线
/// </summary>
public ScoreDecide()
{
this.Excellent = 80;
this.Ordinary = 60;
}
/// <summary>
/// 配置成绩分差线
/// </summary>
/// <param name="excellent">此值设定优秀成绩线</param>
/// <param name="ordinary">此值设定一般成绩线</param>
public ScoreDecide(double excellent, double ordinary)
{
this.Excellent = excellent;
this.Ordinary = ordinary;
}
/// <summary>
/// 对分数进行判定,确定成绩
/// </summary>
/// <param name="grades">成绩值</param>
/// <returns>成绩等级:“优秀”,“一般”,“差”</returns>
public string DetermineGrades(double grades)
{
return grades >= this.Excellent ? "优秀" :
grades >= this.Ordinary ? "一般" : "差";
}
}
追问
能详细说明一下么?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询