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

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

14 Examples 7

1. Example

Project: OKHOSTING.UI
Source File: ControlList.cs
View license
public int IndexOf(IControl item)
		{
			return InnerList.IndexOf((Native.Control) item);
		}

2. Example

Project: Fizzler
Source File: ControlExtensions.cs
View license
public static IEnumerable<Control> ControlsAfterSelf(this Control control)
        {
            if (control == null) throw new ArgumentNullException("control");
            var parent = control.Parent;
            if (parent != null)
            {
                var controls = parent.Controls;
                var i = controls.IndexOf(control) + 1;
                for (; i < controls.Count; i++)
                    yield return controls[i];
            }
        }

3. Example

Project: Fizzler
Source File: ControlExtensions.cs
View license
public static IEnumerable<Control> ControlsBeforeSelf(this Control control)
        {
            if (control == null) throw new ArgumentNullException("control");
            var parent = control.Parent;
            if (parent != null)
            {
                var controls = parent.Controls;
                var count = controls.IndexOf(control);
                for (var i = 0; i < count; i++)
                    yield return controls[i];
            }
        }

4. Example

View license
private void ResetChildIndex()
        {
            // Find the child index of our matching panel
            int panelIndex = _control.Controls.IndexOf(_panel);

            // Position ourself just before the matching panel
            _control.Controls.SetChildIndex(this, panelIndex);
            _control.Controls.SetChildIndex(this, panelIndex);
        }

5. Example

Project: Krypton
Source File: KryptonDockingDockspace.cs
View license
public override void PropogateAction(DockingPropogateAction action, int value)
        {
           /n ..... /n //View Source file for more details /n }

6. Example

Project: QTTabBar
Source File: PluginView.cs
View license
private void pvi_MouseDown(object sender, MouseEventArgs e) {
            int index = Controls.IndexOf((PluginViewItem)sender);
            if(index != -1) {
                SelectPlugin(index);
            }
        }

7. Example

Project: dp2
Source File: BindingForm.cs
View license
void VisibleEditArea(bool bVisible)
        {
            this.checkBox_displayEditArea.Checked = bV/n ..... /n //View Source file for more details /n }

8. Example

Project: ATF
Source File: NumericMatrixControl.cs
View license
protected override bool ProcessDialogKey(Keys keyData)
        {
            NumericTextBox focusTextBox = null;
            foreach (NumericTextBox ctrl in Controls)
            {
                if (ctrl.Focused)
                {
                    focusTextBox = ctrl;
                    break;
                }
            }

            int index = focusTextBox == null ? -1 : Controls.IndexOf(focusTextBox);
            if (keyData == Keys.Tab || keyData == Keys.Enter)
            {
                // if on last NumericTextBox then don't process tab
                NumericTextBox last = (NumericTextBox)Controls[Controls.Count - 1];
                if (focusTextBox != last)
                {
                    Controls[index + 1].Focus();
                    return true;
                }
            }
            else if (keyData == (Keys.Tab | Keys.Shift))
            {
                NumericTextBox first = (NumericTextBox)Controls[0];
                if (focusTextBox != first && index != -1)
                {
                    Controls[index - 1].Focus();
                    return true;

                }
            }
            return base.ProcessDialogKey(keyData);
        }

9. Example

Project: ATF
Source File: NumericMatrixControl.cs
View license
private void textBox_ValueEdited(object sender, EventArgs e)
        {
            NumericTextBox textbox = (NumericTextBox)sender;
            m_component = Controls.IndexOf(textbox);
            Array value = Value as Array;
            m_editing = true;

            OnValueChanged(EventArgs.Empty);

            m_lastChange = value;
            if (!ContainsFocus && m_editing)
            {
                OnValueEdited(EventArgs.Empty);
                m_lastEdit = value;
                m_editing = false;
            }
        }

10. Example

Project: ATF
Source File: NumericTupleControl.cs
View license
protected override bool ProcessDialogKey(Keys keyData)
        {
            NumericTextBox focusTextBox = null;
            foreach (NumericTextBox ctrl in Controls)
            {
                if (ctrl.Focused)
                {
                    focusTextBox = ctrl;
                    break;
                }
            }

            int index = focusTextBox == null ? -1 : Controls.IndexOf(focusTextBox);                
            if (keyData == Keys.Tab || keyData == Keys.Enter)
            {                
                // if on last NumericTextBox then don't process tab
                NumericTextBox last = (NumericTextBox)Controls[Controls.Count - 1];                                                
                if (focusTextBox != last)
                {
                    Controls[index + 1].Focus();
                    return true;                    
                }
            }
            else if (keyData == (Keys.Tab | Keys.Shift))
            {
                NumericTextBox first = (NumericTextBox)Controls[0];
                if (focusTextBox != first && index != -1)
                {
                    Controls[index - 1].Focus();
                    return true;

                }               
            }
            return base.ProcessDialogKey(keyData);
        }

11. Example

Project: ATF
Source File: NumericTupleControl.cs
View license
private void textBox_ValueEdited(object sender, EventArgs e)
        {
            NumericTextBox textbox = (NumericTextBox)sender;
            m_component = Controls.IndexOf(textbox);
            Array value = Value as Array;
            m_editing = true;

            OnValueChanged(EventArgs.Empty);

            m_lastChange = value;
            if (!ContainsFocus && m_editing)
            {
                OnValueEdited(EventArgs.Empty);
                m_lastEdit = value;
                m_editing = false;
            }
        }

12. Example

Project: AltoControls
Source File: Transparenter.cs
View license
public static void MakeTransparent(Control control, Graphics g)
        {
            var parent = control.Parent;
            if (parent == null) return;
            var bounds = control.Bounds;
            var siblings = parent.Controls;
            int index = siblings.IndexOf(control);
            Bitmap behind = null;
            for (int i = siblings.Count - 1; i > index; i--)
            {
                var c = siblings[i];
                if (!c.Bounds.IntersectsWith(bounds)) continue;
                if (behind == null)
                    behind = new Bitmap(control.Parent.ClientSize.Width, control.Parent.ClientSize.Height);
                c.DrawToBitmap(behind, c.Bounds);
            }
            if (behind == null) return;
            g.DrawImage(behind, control.ClientRectangle, bounds, GraphicsUnit.Pixel);
            behind.Dispose();
        }

13. Example

Project: QTTabBar
Source File: PluginView.cs
View license
private bool RemovePluginViewItem(PluginViewItem pvi, bool noRaiseEvent) {
            bool flag;
            SuspendLayout();
            try {
                if(!noRaiseEvent) {
                    PluginOptionEventArgs e = new PluginOptionEventArgs(pvi);
                    if(PluginRemoved != null) {
                        PluginRemoved(this, e);
                        if(e.Cancel) {
                            return false;
                        }
                    }
                }
                int index = Controls.IndexOf(pvi);
                if(iSelectedIndex == index) {
                    iSelectedIndex = -1;
                }
                if(index > -1) {
                    Controls.RemoveAt(index);
                    RowStyles.RemoveAt(index);
                    RowCount--;
                    for(int i = 0; i < Controls.Count; i++) {
                        SetRow(Controls[i], i);
                    }
                    pvi.Dispose();
                    return true;
                }
                flag = false;
            }
            finally {
                ResumeLayout();
            }
            return flag;
        }

14. Example

Project: ClearCanvas
Source File: TrackSlider.cs
View license
protected override void OnPaintBackground(PaintEventArgs e)
		{
			// the base PaintBackground will /n ..... /n //View Source file for more details /n }