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
0
1. Example
View licensepublic int IndexOf(IControl item) { return InnerList.IndexOf((Native.Control) item); }
0
2. Example
View licensepublic 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]; } }
0
3. Example
View licensepublic 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]; } }
0
4. Example
View licenseprivate 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); }
0
5. Example
View licensepublic override void PropogateAction(DockingPropogateAction action, int value) { /n ..... /n //View Source file for more details /n }
0
6. Example
View licenseprivate void pvi_MouseDown(object sender, MouseEventArgs e) { int index = Controls.IndexOf((PluginViewItem)sender); if(index != -1) { SelectPlugin(index); } }
0
7. Example
View licensevoid VisibleEditArea(bool bVisible) { this.checkBox_displayEditArea.Checked = bV/n ..... /n //View Source file for more details /n }
0
8. Example
View licenseprotected 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); }
0
9. Example
View licenseprivate 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; } }
0
10. Example
View licenseprotected 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); }
0
11. Example
View licenseprivate 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; } }
0
12. Example
View licensepublic 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(); }
0
13. Example
View licenseprivate 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; }
0
14. Example
View licenseprotected override void OnPaintBackground(PaintEventArgs e) { // the base PaintBackground will /n ..... /n //View Source file for more details /n }