这几天在帮佳讯做作业,写个简单的在线考试的东东..
一不小心就天亮了,今天他就要交了,还好赶得及.昨晚还算有点收获.呵呵~
下面这个函数是我在写试题的多重选择时判断是否选择多个写的.觉得有点用,记录下来先.
/**/
/// <summary>
/// 判断是否多选
/// </summary>
/// <param name="cbs">CheckBox数组</param>
/// <returns>多选返回True</returns>
private bool IsMultiSelect(CheckBox[] cbs)
... {
bool isEqual=false;
for (int i = 0; i < cbs.Length; i++)
...{
for (int j = i+1; j < cbs.Length; j++)
...{
if (cbs[i].Checked & cbs[j].Checked)
...{
isEqual = true;
break;
}
}
}
return isEqual;
}
/// 判断是否多选
/// </summary>
/// <param name="cbs">CheckBox数组</param>
/// <returns>多选返回True</returns>
private bool IsMultiSelect(CheckBox[] cbs)
... {
bool isEqual=false;
for (int i = 0; i < cbs.Length; i++)
...{
for (int j = i+1; j < cbs.Length; j++)
...{
if (cbs[i].Checked & cbs[j].Checked)
...{
isEqual = true;
break;
}
}
}
return isEqual;
}