0

I have a program which have multiple check boxes on a windows form. I am using Bunifu framework for the check boxes. I want to loop through all the check boxes. However, I can't seem to loop through with bunifu check boxes, it works with normal check boxes.

I have tried the following code. It works as intended with normal check boxes but not working for bunifu check boxes. The code doesn't think its a checkbox I believe.

foreach (Control ctrl in this.Controls)
            {
                if (ctrl is CheckBox)
                {
                    if(((CheckBox)ctrl).Checked == true)
                    {

                       //main code here

                    }
                }
            }

I want to be able to do same thing but with the bunifu check boxes. Is there something I am missing.

Thanks for your help.

4

1 回答 1

0

做类似的事情,但请确保您使用的是最新的 Bunifu 框架。

foreach (Bunifu.UI.WinForms.BunifuCheckBox ctrl in this.Controls)
            {
                if (ctrl is Bunifu.UI.WinForms.BunifuCheckBox)
                {
                    if(((Bunifu.UI.WinForms.BunifuCheckBox)ctrl).Checked == true)
                    {

                       //main code here

                    }
                }`enter code here`
            }
于 2019-06-24T11:31:40.373 回答