Control.GetNextControl(Control, Boolean) Control.GetNextControl(Control, Boolean) Control.GetNextControl(Control, Boolean) Control.GetNextControl(Control, Boolean) Method

定义

按照子控件的 Tab 键顺序向前或向后检索下一个控件。Retrieves the next control forward or back in the tab order of child controls.

public:
 System::Windows::Forms::Control ^ GetNextControl(System::Windows::Forms::Control ^ ctl, bool forward);
public System.Windows.Forms.Control GetNextControl (System.Windows.Forms.Control ctl, bool forward);
member this.GetNextControl : System.Windows.Forms.Control * bool -> System.Windows.Forms.Control
Public Function GetNextControl (ctl As Control, forward As Boolean) As Control

参数

ctl
Control Control Control Control

从其上开始搜索的 ControlThe Control to start the search with.

forward
Boolean Boolean Boolean Boolean

如果是 true,则按 Tab 键顺序向前搜索;如果是 false 则向后搜索。true to search forward in the tab order; false to search backward.

返回

Tab 键顺序指定的下一个 ControlThe next Control in the tab order.

注解

GetNextControl方法依赖于 tab 键顺序。The GetNextControl method is dependent on tab order. 若要循环访问窗体的所有控件(包括嵌套控件), Controls请使用属性。To iterate through all controls of a form, including nested controls, use the Controls property. 若要获取或设置容器控件的活动控件,请使用ActiveControl属性。To get or set the active control of a container control, use the ActiveControl property.

适用于

另请参阅