Export (0) Print
Expand All

Control.Select Method

Activates a control.

Overload List

Activates the control.

[Visual Basic] Overloads Public Sub Select()
[C#] public void Select();
[C++] public: void Select();
[JScript] public function Select();

Activates a child control. Optionally specifies the direction in the tab order to select the control from.

[Visual Basic] Overloads Protected Overridable Sub Select(Boolean, Boolean)
[C#] protected virtual void Select(bool, bool);
[C++] protected: virtual void Select(bool, bool);
[JScript] protected function Select(Boolean, Boolean);

Example

[Visual Basic, C#, C++] The following example selects the specified Control, if it is selectable.

[Visual Basic, C#, C++] Note   This example shows how to use one of the overloaded versions of Select. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
Public Sub ControlSelect(control As Control)
   ' Select the control, if it can be selected.
   If control.CanSelect Then
      control.Select()
   End If
End Sub

[C#] 
public void ControlSelect(Control control)
{
   // Select the control, if it can be selected.
   if(control.CanSelect)
   {
      control.Select();
   }
}

[C++] 
public:
   void ControlSelect(Control* control) {
      // Select the control, if it can be selected.
      if (control->CanSelect) {
         control->Select();
      }
   }

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

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

Show:
© 2014 Microsoft