ComponentFactory.Krypton.Toolkit.KryptonCheckButtonCollectionForm.KryptonCheckButtonCollectionForm_Load C# (CSharp) Method

KryptonCheckButtonCollectionForm_Load() private method

private KryptonCheckButtonCollectionForm_Load ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        private void KryptonCheckButtonCollectionForm_Load(object sender, EventArgs e)
        {
            // Get access to the container of the check set
            IContainer container = _checkSet.Container;

            // Assuming we manage to find a container
            if (container != null)
            {
                // Find all the check buttons inside the container
                foreach (object obj in container.Components)
                {
                    // We are only interested in check buttons
                    if (obj is KryptonCheckButton)
                    {
                        // Cast to the correct type
                        KryptonCheckButton checkButton = (KryptonCheckButton)obj;

                        // Add a new entry to the list box but only check it if
                        // it is already present in the check buttons collection
                        checkedListBox.Items.Add(new ListEntry(checkButton),
                                                 _checkSet.CheckButtons.Contains(checkButton));
                    }
                }
            }
        }