Control.CanSelect Propriété
Définition
Obtient une valeur indiquant si le contrôle peut être sélectionné.Gets a value indicating whether the control can be selected.
public:
property bool CanSelect { bool get(); };
[System.ComponentModel.Browsable(false)]
public bool CanSelect { get; }
member this.CanSelect : bool
Public ReadOnly Property CanSelect As Boolean
Valeur de propriété
true
si le contrôle peut être sélectionné ; sinon, false
.true
if the control can be selected; otherwise, false
.
- Attributs
Exemples
L’exemple de code suivant sélectionne le Controlspécifié, s’il est sélectionnable.The following code example selects the specified Control, if it is selectable.
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 Sub ControlSelect(control As Control)
' Select the control, if it can be selected.
If control.CanSelect Then
control.Select()
End If
End Sub
Remarques
Cette propriété retourne true
si la valeur Selectable
de System.Windows.Forms.ControlStyles est définie sur true
, si elle est contenue dans un autre contrôle, si le contrôle lui-même est visible et activé, et que tous ses contrôles parents sont visibles et activés.This property returns true
if the Selectable
value of System.Windows.Forms.ControlStyles is set to true
, is contained in another control, the control itself is visible and enabled, and all its parent controls are visible and enabled.
Les contrôles Windows Forms de la liste suivante ne peuvent pas être sélectionnés et retournent une valeur de false
pour la propriété CanSelect.The Windows Forms controls in the following list are not selectable and will return a value of false
for the CanSelect property. Les contrôles dérivés de ces contrôles ne peuvent pas non plus être sélectionnés.Controls derived from these controls are also not selectable.
LinkLabel (lorsqu’il n’y a aucun lien présent dans le contrôle)LinkLabel (when there is no link present in the control)