System.Windows.Forms.Control.SelectNextControl Method

Activates the next control.

Syntax

public bool SelectNextControl (Control ctl, bool forward, bool tabStopOnly, bool nested, bool wrap)

Parameters

ctl
The System.Windows.Forms.Control at which to start the search.
forward
true to move forward in the tab order; false to move backward in the tab order.
tabStopOnly
true to ignore the controls with the Control.TabStop property set to false; otherwise, false.
nested
true to include nested (children of child controls) child controls; otherwise, false.
wrap
true to continue searching from the first control in the tab order after the last control has been reached; otherwise, false.

Returns

true if a control was activated; otherwise, false.

Remarks

The Control.SelectNextControl(Control, bool, bool, bool, bool) method activates the next control in the tab order if the control's Selectable style bit is set to true in System.Windows.Forms.ControlStyles, it is contained in another control, and all its parent controls are both visible and enabled.

The Windows Forms controls in the following list are not selectable. Controls derived from controls in the list will also not be selectable.

When you change the focus by using the keyboard (TAB, SHIFT+TAB, and so on), by calling the Control.Select or Control.SelectNextControl(Control, bool, bool, bool, bool) methods, or by setting the ContainerControl.ActiveControl property to the current form, focus events occur in the following order:

[The 'ordered' type of list has not been implemented in the ECMA stylesheet.]

If the Control.CausesValidation property is set to false, the Control.Validating and Control.Validated events are suppressed.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0