次の方法で共有


Control.Select メソッド ()

コントロールをアクティブにします。

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

解説

コントロールの ControlStyles.Selectable スタイル ビットが true に設定されていて、別のコントロールに含まれており、すべての親コントロールが表示されていて有効である場合、 Select メソッドはコントロールをアクティブにします。

選択できない Windows フォーム コントロールの一覧を次に示します。一覧に示されているコントロールから派生したコントロールも選択できません。

使用例

[Visual Basic, C#, C++] 指定した Control が選択可能である場合に、そのコントロールを選択する例を次に示します。

 
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] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

Control クラス | Control メンバ | System.Windows.Forms 名前空間 | Control.Select オーバーロードの一覧 | Focus | SelectNextControl