Adorner.Enabled プロパティ

定義

Adorner が有効になっているかどうかを示す値を取得または設定します。

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

プロパティ値

Boolean

Adorner が有効な場合は true。それ以外の場合は false

次のコード例では、次のコードを有効または無効にする方法を Adorner示します。 完全なコード一覧については、「 方法: デザイン モードでコントロールの外観と動作を拡張する」を参照してください。

// 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

注釈

プロパティが指定されているEnabled場合、BehaviorServicetrueクラスは HitTest Paint Adorner.

適用対象

こちらもご覧ください