Export (0) Print
Expand All
Expand Minimize

Control.SelectNextControl Method

Activates the next control.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

'Declaration
Public Function SelectNextControl ( _
	ctl As Control, _
	forward As Boolean, _
	tabStopOnly As Boolean, _
	nested As Boolean, _
	wrap As Boolean _
) As Boolean
'Usage
Dim instance As Control
Dim ctl As Control
Dim forward As Boolean
Dim tabStopOnly As Boolean
Dim nested As Boolean
Dim wrap As Boolean
Dim returnValue As Boolean

returnValue = instance.SelectNextControl(ctl, forward, tabStopOnly, nested, wrap)
public boolean SelectNextControl (
	Control ctl, 
	boolean forward, 
	boolean tabStopOnly, 
	boolean nested, 
	boolean wrap
)
public function SelectNextControl (
	ctl : Control, 
	forward : boolean, 
	tabStopOnly : boolean, 
	nested : boolean, 
	wrap : boolean
) : boolean
Not applicable.

Parameters

ctl

The 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 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.

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 Selectable style bit is set to true in 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 Select or SelectNextControl methods, or by setting the ContainerControl.ActiveControl property to the current form, focus events occur in the following order:

  1. Enter

  2. GotFocus

  3. Leave

  4. Validating

  5. Validated

  6. LostFocus

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

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft