Adorner.Enabled Własność
Definicja
Ważny
Niektóre informacje dotyczą produktów przedpremierowych, które mogą zostać znacznie zmodyfikowane przed premierą. Microsoft nie udziela żadnych gwarancji, ani wyraźnych, ani domniemanych, dotyczących informacji podanych tutaj.
Pobiera lub ustawia wartość wskazującą Adorner , czy parametr jest włączony.
public:
property bool Enabled { bool get(); void set(bool value); };
public bool Enabled { get; set; }
member this.Enabled : bool with get, set
Public Property Enabled As Boolean
Wartość nieruchomości
true, jeśli parametr Adorner jest włączony; w przeciwnym razie . false
Przykłady
W poniższym przykładzie kodu pokazano, jak włączyć i wyłączyć element Adorner. Aby uzyskać pełną listę kodu, zobacz How to: Extend the Appearance and Behavior of Controls in Design Mode (Instrukcje: rozszerzanie wyglądu i zachowania kontrolek w trybie projektowania).
// The AnchorGlyph objects should mimic the resize glyphs;
// they should only be visible when the control is the
// primary selection. The adorner is enabled when the
// control is the primary selection and disabled when
// it is not.
void selectionService_SelectionChanged(object sender, EventArgs e)
{
if (object.ReferenceEquals(
this.selectionService.PrimarySelection,
this.relatedControl))
{
this.ComputeBounds();
this.anchorAdorner.Enabled = true;
}
else
{
this.anchorAdorner.Enabled = false;
}
}
' The AnchorGlyph objects should mimic the resize glyphs;
' they should only be visible when the control is the
' primary selection. The adorner is enabled when the
' control is the primary selection and disabled when
' it is not.
Private Sub selectionService_SelectionChanged( _
ByVal sender As Object, _
ByVal e As EventArgs)
If Object.ReferenceEquals( _
Me.selectionService.PrimarySelection, _
Me.relatedControl) Then
Me.ComputeBounds()
Me.anchorAdorner.Enabled = True
Else
Me.anchorAdorner.Enabled = False
End If
End Sub
Uwagi
Enabled Jeśli właściwość ma truewartość , BehaviorService klasa wyśle HitTest komunikaty i Paint do klasy Adorner.