This documentation is archived and is not being maintained.

Control.SelectNextControl Method

Activates the next control.

[Visual Basic]
Public Function SelectNextControl( _
   ByVal ctl As Control, _
   ByVal forward As Boolean, _
   ByVal tabStopOnly As Boolean, _
   ByVal nested As Boolean, _
   ByVal wrap As Boolean _
) As Boolean
public bool SelectNextControl(
 Control ctl,
 bool forward,
 bool tabStopOnly,
 bool nested,
 bool wrap
public: bool SelectNextControl(
 Control* ctl,
 bool forward,
 bool tabStopOnly,
 bool nested,
 bool wrap
public function SelectNextControl(
   ctl : Control,
 forward : Boolean,
 tabStopOnly : Boolean,
 nested : Boolean,
 wrap : Boolean
) : Boolean;


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

Return Value

true if a control was activated; otherwise, false.


The SelectNextControl method activates the next control in the tab order if the control's ControlStyles.Selectable style bit set to true, 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.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Control Class | Control Members | System.Windows.Forms Namespace | Select | Focus