System.Windows.Forms.Control.ControlCollection.GetEnumerator()

Here are the examples of the csharp api class System.Windows.Forms.Control.ControlCollection.GetEnumerator() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

5 Examples 7

1. Example

Project: Legends-Viewer
Source File: CriteriaPanel.cs
View license
public void AutoResize()
        {
            int panelHeight = 0;
            int panelWidth = 0;
            System.Collections.IEnumerator selectionEnumerator = Controls.GetEnumerator();
            while (selectionEnumerator.MoveNext())
            {
                if ((selectionEnumerator.Current as Control).Bottom > panelHeight)
                    panelHeight = (selectionEnumerator.Current as Control).Bottom;
                if ((selectionEnumerator.Current as Control).Right > panelWidth)
                    panelWidth = (selectionEnumerator.Current as Control).Right;
            }
            Height = panelHeight + 3;
            Width = panelWidth + 3;
        }

2. Example

Project: VisualPlus
Source File: VisualTabControl.cs
View license
protected override void OnControlAdded(ControlEventArgs e)
        {
            base.OnControlAdded(e);
            if (!(e.Control is TabPage))
            {
                return;
            }

            try
            {
                IEnumerator enumerator = Controls.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    using (new TabPage())
                    {
                        BackColor = _backgroundColor;
                    }
                }
            }
            finally
            {
                GraphicsManager.SetControlBackColor(e.Control, _backgroundColor, false);
            }
        }

3. Example

Project: Launcher_Multigaming
Source File: Italk.cs
View license
protected override void OnControlAdded(ControlEventArgs e)
        {
            base.OnControlAdded(e);
            if (e.Control is TabPage)
            {
                IEnumerator enumerator;
                try
                {
                    enumerator = this.Controls.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        TabPage current = (TabPage)enumerator.Current;
                        current = new TabPage();
                    }
                }
                finally
                {
                    e.Control.BackColor = Color.FromArgb(246, 246, 246);
                }
            }
        }

4. Example

Project: Launcher_Multigaming
Source File: Italk.cs
View license
protected override void OnControlAdded(ControlEventArgs e)
        {
            base.OnControlAdded(e);
            if (e.Control is TabPage)
            {
                IEnumerator enumerator;
                try
                {
                    enumerator = this.Controls.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        TabPage current = (TabPage)enumerator.Current;
                        current = new TabPage();
                    }
                }
                finally
                {
                    e.Control.BackColor = Color.FromArgb(246, 246, 246);
                }
            }
        }

5. Example

Project: Launcher_Multigaming
Source File: Italk.cs
View license
protected override void OnControlAdded(ControlEventArgs e)
        {
            base.OnControlAdded(e);
            if (e.Control is TabPage)
            {
                IEnumerator enumerator;
                try
                {
                    enumerator = this.Controls.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        TabPage current = (TabPage)enumerator.Current;
                        current = new TabPage();
                    }
                }
                finally
                {
                    e.Control.BackColor = Color.FromArgb(246, 246, 246);
                }
            }
        }