本文整理汇总了C#中System.Windows.Forms.CheckBox.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# CheckBox.Equals方法的具体用法?C# CheckBox.Equals怎么用?C# CheckBox.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.CheckBox
的用法示例。
在下文中一共展示了CheckBox.Equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: checkBox_CheckedChanged
/*
* this method will analysis the results in check box groups
* and do ccessory calculation for different situation.
*/
private void checkBox_CheckedChanged(object sender, EventArgs e)
{
chekBox = (CheckBox)sender;
if (chekBox.Equals(checkBoxAPP))
{
if (checkBoxAPP.Checked)
accessoriesPrice += ProtectionPlan;
else
{
accessoriesPrice -= ProtectionPlan;
}
}
else if (chekBox.Equals(checkBoxSP))
{
if (checkBoxSP.Checked)
{
accessoriesPrice += ScreenProtector;
}
else
{
accessoriesPrice -= ScreenProtector;
}
}
else if (chekBox.Equals(checkBoxLC))
{
if (checkBoxLC.Checked)
{
accessoriesPrice += LeatherCase;
}
else
{
accessoriesPrice -= LeatherCase;
}
}
else
{
// do nothing
}
}
示例2: OnlyOneCheck
public void OnlyOneCheck(CheckBox[] ckbList, CheckBox ckb)
{
int num2;
int length = ckbList.Length;
bool flag = false;
for (num2 = 0; num2 < length; num2++)
{
if (ckb.Equals(ckbList[num2]))
{
flag = true;
}
}
if (ckb.Checked && flag)
{
for (num2 = 0; num2 < length; num2++)
{
if (!ckb.Equals(ckbList[num2]))
{
ckbList[num2].Checked = false;
ckbList[num2].Enabled = true;
}
}
}
}