AdornerPanel.SetAdornerMargin 方法

设置所提供元素的指定 AdornerMargin 附加属性。

命名空间:  Microsoft.Windows.Design.Interaction
程序集:  Microsoft.Windows.Design.Interaction(在 Microsoft.Windows.Design.Interaction.dll 中)

语法

声明
Public Shared Sub SetAdornerMargin ( _
    obj As DependencyObject, _
    value As Thickness _
)
public static void SetAdornerMargin(
    DependencyObject obj,
    Thickness value
)
public:
static void SetAdornerMargin(
    DependencyObject^ obj, 
    Thickness value
)
static member SetAdornerMargin : 
        obj:DependencyObject * 
        value:Thickness -> unit 
public static function SetAdornerMargin(
    obj : DependencyObject, 
    value : Thickness
)

参数

示例

下面的代码示例演示如何使用 SetAdornerMargin 方法为装饰器指定边距。 有关更多信息,请参见 演练:创建设计时装饰器

' The slider extends the full width of the control it adorns.
AdornerPanel.SetAdornerHorizontalAlignment( _
    opacitySlider, _
    AdornerHorizontalAlignment.Stretch)

' Position the adorner above the control it adorns.
AdornerPanel.SetAdornerVerticalAlignment( _
    opacitySlider, _
    AdornerVerticalAlignment.OutsideTop)

' Position the adorner 5 pixels above the control. 
AdornerPanel.SetAdornerMargin( _
    opacitySlider, _
    New Thickness(0, 0, 0, 5))
// The slider extends the full width of the control it adorns.
AdornerPanel.SetAdornerHorizontalAlignment( 
    opacitySlider, 
    AdornerHorizontalAlignment.Stretch);

// Position the adorner above the control it adorns.
AdornerPanel.SetAdornerVerticalAlignment(
    opacitySlider, 
    AdornerVerticalAlignment.OutsideTop);

// Position the adorner 5 pixels above the control. 
AdornerPanel.SetAdornerMargin(
    opacitySlider, 
    new Thickness(0, 0, 0, 5));

.NET Framework 安全性

请参见

参考

AdornerPanel 类

Microsoft.Windows.Design.Interaction 命名空间

其他资源

装饰器体系结构

功能提供程序和功能连接器