Control プロパティ


.NET Framework クラス ライブラリ
Control..::.CanSelect プロパティ

更新 : 2007 年 11 月

コントロールを選択できるかどうかを示す値を取得します。

名前空間 :  System.Windows.Forms
アセンブリ :  System.Windows.Forms (System.Windows.Forms.dll 内)

構文

Visual Basic (宣言)
<BrowsableAttribute(False)> _
Public ReadOnly Property CanSelect As Boolean
Visual Basic (使用法)
Dim instance As Control
Dim value As Boolean

value = instance.CanSelect
C#
[BrowsableAttribute(false)]
public bool CanSelect { get; }
Visual C++
[BrowsableAttribute(false)]
public:
property bool CanSelect {
    bool get ();
}
J#
/** @property */
/** @attribute BrowsableAttribute(false) */
public boolean get_CanSelect()
JScript
public function get CanSelect () : boolean

プロパティ値

型 : System..::.Boolean

コントロールを選択できる場合は true。それ以外の場合は false

解説

System.Windows.Forms..::.ControlStylesSelectable 値が true に設定されていて、別のコントロールに含まれており、コントロール自体とすべての親コントロールが表示されていて有効である場合、このプロパティは true を返します。

CanSelect プロパティに対して false の値を返す、選択できない Windows フォーム コントロールの一覧を次に示します。これらのコントロールから派生したコントロールも、選択できません。


指定した Control が選択可能である場合に、そのコントロールを選択するコード例を次に示します。

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();
   }
}
Visual C++
public:
   void ControlSelect( Control^ control )
   {

      // Select the control, if it can be selected.
      if ( control->CanSelect )
      {
         control->Select(  );
      }
   }
J#
public void ControlSelect(Control control)
{
    // Select the control, if it can be selected.
    if (control.get_CanSelect()) {
        control.Select();
    }
} //ControlSelect
プラットフォーム

Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 3.5、3.0、2.0、1.1、1.0
参照

参照

タグ :


Page view tracker