更新 : 2007 年 11 月
コントロールを選択できるかどうかを示す値を取得します。
名前空間 :
System.Windows.Forms アセンブリ :
System.Windows.Forms (System.Windows.Forms.dll 内)
<BrowsableAttribute(False)> _
Public ReadOnly Property CanSelect As Boolean
Dim instance As Control
Dim value As Boolean
value = instance.CanSelect
[BrowsableAttribute(false)]
public bool CanSelect { get; }
[BrowsableAttribute(false)]
public:
property bool CanSelect {
bool get ();
}
/** @property */
/** @attribute BrowsableAttribute(false) */
public boolean get_CanSelect()
public function get CanSelect () : boolean
System.Windows.Forms..::.ControlStyles の Selectable 値が true に設定されていて、別のコントロールに含まれており、コントロール自体とすべての親コントロールが表示されていて有効である場合、このプロパティは true を返します。
CanSelect プロパティに対して false の値を返す、選択できない Windows フォーム コントロールの一覧を次に示します。これらのコントロールから派生したコントロールも、選択できません。
指定した 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
public void ControlSelect(Control control)
{
// Select the control, if it can be selected.
if(control.CanSelect)
{
control.Select();
}
}
public:
void ControlSelect( Control^ control )
{
// Select the control, if it can be selected.
if ( control->CanSelect )
{
control->Select( );
}
}
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
参照