AdornerPanel.SetAdornerVerticalAlignment 方法
[本文档仅供预览,在以后的发行版中可能会发生更改。包含的空白主题用作占位符。]
设置所提供元素的指定 AdornerVerticalAlignment 附加属性。
命名空间: Microsoft.Windows.Design.Interaction
程序集: Microsoft.Windows.Design.Interaction(在 Microsoft.Windows.Design.Interaction.dll 中)
语法
声明
Public Shared Sub SetAdornerVerticalAlignment ( _
obj As DependencyObject, _
value As AdornerVerticalAlignment _
)
public static void SetAdornerVerticalAlignment(
DependencyObject obj,
AdornerVerticalAlignment value
)
public:
static void SetAdornerVerticalAlignment(
DependencyObject^ obj,
AdornerVerticalAlignment value
)
static member SetAdornerVerticalAlignment :
obj:DependencyObject *
value:AdornerVerticalAlignment -> unit
public static function SetAdornerVerticalAlignment(
obj : DependencyObject,
value : AdornerVerticalAlignment
)
参数
- obj
类型:System.Windows.DependencyObject
附加属性所写入的元素。
- value
类型:Microsoft.Windows.Design.Interaction.AdornerVerticalAlignment
要设置到 AdornerPanel 的 AdornerVerticalAlignment。
示例
下面的代码示例演示如何使用 SetAdornerVerticalAlignment 方法为装饰器指定垂直对齐。 有关更多信息,请参见演练:创建设计时装饰器。
' 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 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。
请参见
参考
Microsoft.Windows.Design.Interaction 命名空间