Proprietà Shape.ContainsFocus
Ottiene un valore che indica se un controllo Line o Shape ha lo stato attivo per l'input.
Spazio dei nomi: Microsoft.VisualBasic.PowerPacks
Assembly: Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)
Sintassi
'Dichiarazione
<BrowsableAttribute(False)> _
Public ReadOnly Property ContainsFocus As Boolean
[BrowsableAttribute(false)]
public bool ContainsFocus { get; }
[BrowsableAttribute(false)]
public:
property bool ContainsFocus {
bool get ();
}
[<BrowsableAttribute(false)>]
member ContainsFocus : bool with get
function get ContainsFocus () : boolean
Valore proprietà
Tipo: Boolean
true se il controllo dispone attualmente dello stato attivo per l'input; in caso contrario, false.
Note
Per LineShape, OvalShape, e RectangleShape controlla il valore della ContainsFocus proprietà è uguale a quello del Focused proprietà.
Per assegnare un controllo attivo per l'input, utilizzare il Focus o Select metodi.
Esempi
I report di esempio riportato di seguito se l'oggetto specificato Shape attualmente ha lo stato attivo.
Public Sub ReportFocus(ByVal shape As Microsoft.VisualBasic.PowerPacks.Shape)
' Determine whether the Shape has focus.
If shape.ContainsFocus Then
MsgBox(shape.Name & " has focus.")
End If
End Sub
public void ReportFocus(Microsoft.VisualBasic.PowerPacks.Shape shape)
{
// Determine whether the Shape has focus.
if (shape.ContainsFocus)
{
MessageBox.Show(shape.Name + " has focus.");
}
}
Sicurezza di .NET Framework
- Attendibilità totale per il chiamante immediato. Impossibile utilizzare questo membro in codice parzialmente attendibile. Per altre informazioni, vedere Utilizzo di librerie da codice parzialmente attendibile.
Vedere anche
Riferimenti
Spazio dei nomi Microsoft.VisualBasic.PowerPacks
Altre risorse
Procedura: disegnare linee con il controllo LineShape (Visual Studio)
Procedura: disegnare forme con i controlli OvalShape e RectangleShape (Visual Studio)