zoukankan      html  css  js  c++  java
  • winform中CheckBox实现单选(转载)

    一组CheckBox实现单选

    加个GroupBox(或其它容器) 把几个CheckBox 放到容器中。CheckBox_CheckedChanged事件指定下面方法:

    private void CheckBox_CheckedChanged(object sender, EventArgs e) {

                if ((sender as CheckBox).Checked == true) {

                    foreach (CheckBox chk in (sender as CheckBox).Parent.Controls) {

                        if (chk != sender) {

                            chk.Checked = false;

                        }

                    }

                }

            }

  • 相关阅读:
    UVA
    UVA
    UVA
    UVA
    NLP介绍
    新建Springboot项目
    添加ssh密钥
    git 错误合集
    Git入门操作
    Hadoop MapReduce
  • 原文地址:https://www.cnblogs.com/wenjie/p/3044736.html
Copyright © 2011-2022 走看看