C# winform遍历GroupBox,GroupBox遍历CheckBox

foreach (Control groupBox in Controls)
            {
                if (groupBox is GroupBox)
                {
                    foreach (CheckBox checkBox in groupBox.Controls)
                    {
                        if (checkBox.Checked)
                        {
                            //
                        }
                    }
                }
            }

 

你可能感兴趣的:(C#-winform)